π Google AI Streaming Example with LangChain Go
Hello there, Go enthusiasts and AI adventurers! π Welcome to this exciting example that showcases how to use Google AI's Gemini model with streaming capabilities using LangChain Go!
π What This Example Does
This nifty little program does the following:
- π It uses your Google API key to authenticate with Google AI services.
- π€ It sets up a connection to the Gemini 1.5 Pro model.
- π§ββοΈ It creates a fun scenario where the AI acts as a "company branding design wizard".
- π¬ It asks the AI to suggest a good company name for a business that produces Go-backed LLM tools.
- π It streams the AI's response in real-time, printing each chunk as it arrives.
π How to Run
- Make sure you have Go installed on your system.
- Set your Google API key as an environment variable:
export GOOGLE_API_KEY=your_api_key_here
- Run the example:
go run googleai-streaming-example.go
π What to Expect
When you run this example, you'll see the AI's response streaming in real-time to your console. It's like watching a creative genius at work, coming up with a brilliant company name right before your eyes!
π Customization
Feel free to modify the system message or the question to explore different scenarios. You can also change the model by updating the WithDefaultModel
parameter.
Happy coding, and may your Go-backed LLM tools company have the coolest name in town! π