An open API service indexing awesome lists of open source software.

https://github.com/httpjamesm/together-ai-go

Go API library for together.ai
https://github.com/httpjamesm/together-ai-go

ai go golang togetherai

Last synced: 7 months ago
JSON representation

Go API library for together.ai

Awesome Lists containing this project

README

          

# together-ai-go

Unofficial API library for [together.ai](https://together.ai)

## Quickstart

### Create a new client

```go
client := togetherai.NewClient(os.Getenv("TOGETHERAI_API_KEY"))
```

### Infer with a model

```go
resp, err := client.NewInference(InferenceConfig{
Model: "togethercomputer/RedPajama-INCITE-7B-Instruct",
Prompt: "The capital of France is",
MaxTokens: 128,
Stop: &stopStrings,
})
if err != nil {
panic(err)
}

fmt.Println(resp.Output.Choices)
```