Golang SDK for Anthropic Claude AI
This is under testing and improvement, please do not use it in important situations
Only support Claude 3
go get github.com/freeeverett/[email protected]
package main
import (
"context"
"fmt"
"github.com/freeeverett/claude-go"
)
func main() {
// A simple example
apiKey := ""
cli := claude.New(apiKey)
text := "Tell a joke"
r, err := cli.CreateSimpleMessage(context.TODO(),text)
if err != nil {
fmt.Println(err)
return
}
fmt.Println(r)
}
For other usage, please refer to server_test.go
- Unified Error Format