Lightweight, type-safe Go SDK for the Edgee AI Gateway.
go get github.com/edgee-cloud/go-sdk/edgeepackage main
import (
"fmt"
"log"
"github.com/edgee-cloud/go-sdk/edgee"
)
func main() {
client, err := edgee.NewClient("your-api-key")
if err != nil {
log.Fatal(err)
}
response, err := client.Send("gpt-4o", "What is the capital of France?")
if err != nil {
log.Fatal(err)
}
fmt.Println(response.Text())
// "The capital of France is Paris."
}The Send() method makes non-streaming chat completion requests:
response, err := client.Send("gpt-4o", "Hello, world!")
if err != nil {
log.Fatal(err)
}
// Access response
fmt.Println(response.Text()) // Text content
fmt.Println(response.FinishReason()) // Finish reason
fmt.Println(response.ToolCalls()) // Tool calls (if any)The Stream() method enables real-time streaming responses:
chunkChan, errChan := client.Stream("gpt-4o", "Tell me a story")
for {
select {
case chunk, ok := <-chunkChan:
if !ok {
return
}
if text := chunk.Text(); text != "" {
fmt.Print(text)
}
if reason := chunk.FinishReason(); reason != "" {
fmt.Printf("\nFinished: %s\n", reason)
}
case err := <-errChan:
if err != nil {
log.Fatal(err)
}
}
}- ✅ Type-safe - Strong typing with Go structs and interfaces
- ✅ OpenAI-compatible - Works with any model supported by Edgee
- ✅ Streaming - Real-time response streaming with channels
- ✅ Tool calling - Full support for function calling
- ✅ Flexible input - Accept strings, InputObject, or maps
- ✅ Minimal dependencies - Uses only standard library and essential packages
For complete documentation, examples, and API reference, visit:
👉 Official Go SDK Documentation
The documentation includes:
- Configuration guide - Multiple ways to configure the SDK
- Send method - Complete guide to non-streaming requests
- Stream method - Streaming responses guide
- Tools - Function calling guide
Licensed under the Apache License, Version 2.0. See LICENSE for details.