An UNOFFICIAL API wrapper for Groq's API for Golang
This is an unofficial project and is not affiliated with Groq in any way.
Currently vision APIs and Streaming results are unsupported (I plan to have this complete soon)
Run:
go get github.com/grqphical/groq
In order to use this library you need a Groq API key. You can get one for free from here
package main
import "github.com/grqphical/groq"
const apiKey string = "API_KEY_HERE"
func main() {
client, err := groq.NewClient(apiKey)
if err != nil {
panic(err)
}
conversation := groq.NewConversation("answer using markdown only if necessary")
conversation.AddMessages(groq.Message{
Role: groq.MessageRoleUser,
Content: "How tall is the Eifel Tower?"
})
response, err := conversation.Complete(client, "llama-3-8b-8192", nil)
if err != nil {
panic(err)
}
fmt.Printf("%s\n", response.Choices[0].Message.Content)
}
groq
is licensed under the MIT license