π¦ Maritaca Chat Example
Hello there! π This fun little Go program demonstrates how to use the Maritaca AI language model to answer questions. Let's break it down!
π― What does this example do?
This example:
- Sets up a connection to the Maritaca AI service
- Asks a simple question about Brazil's population
- Prints out the AI's response
π Key Components
- We're using the
github.com/3dsinteractive/langchaingo/llms/maritaca
package to interact with Maritaca AI.
- The program reads your Maritaca API key from an environment variable called
MARITACA_KEY
.
- We're using the "sabia-2-medium" model, which is pretty smart!
π How it works
- First, we set up our Maritaca client with the API key and model choice.
- Then, we prepare a simple question: "How many people live in Brazil?"
- We send this question to the AI using the
Call
method.
- Finally, we print out whatever answer the AI gives us!
π Running the example
To run this example, make sure you:
- Have your Maritaca API key set as an environment variable.
- Have all the necessary Go packages installed.
Then just run the program and see what the AI says about Brazil's population!
π€ Why is this cool?
This example shows how easy it is to integrate AI into your Go programs. With just a few lines of code, you can ask an AI model complex questions and get intelligent responses. How awesome is that? π
Happy coding, and have fun chatting with AI! π€π¬