maritaca-example

command
v1.0.12 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 1, 2024 License: MIT Imports: 4 Imported by: 0

README ΒΆ

🦜 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:

  1. Sets up a connection to the Maritaca AI service
  2. Asks a simple question about Brazil's population
  3. 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

  1. First, we set up our Maritaca client with the API key and model choice.
  2. Then, we prepare a simple question: "How many people live in Brazil?"
  3. We send this question to the AI using the Call method.
  4. Finally, we print out whatever answer the AI gives us!

πŸŽ‰ Running the example

To run this example, make sure you:

  1. Have your Maritaca API key set as an environment variable.
  2. 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! πŸ€–πŸ’¬

Documentation ΒΆ

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL