Skip to content
/ groq Public

An unofficial API wrapper for GroqCloud in Golang

License

Notifications You must be signed in to change notification settings

grqphical/groq

Repository files navigation

groq

GitHub License GitHub Tag Go Tests Go Reference

An UNOFFICIAL API wrapper for Groq's API for Golang

NOTE:

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)

Installation

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

Example

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)
}

License

groq is licensed under the MIT license

About

An unofficial API wrapper for GroqCloud in Golang

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages