المشاريع
عرض على GitHub
anthropics/anthropic-sdk-go
حول
إمكانية الوصول عبر Go إلى واجهات API للنماذج اللغوية من Anthropic، المصممة مع إعطاء الأولوية للسلامة.
الذكاء الاصطناعي وتعلّم الآلةالنمو المقاس للنجوم
- خلال 24 ساعة
- ٠
- خلال 7 أيام
- +٦
- خلال 15 يومًا
- +١١
- خلال شهر
- +٢١
تغيّر صافي النجوم خلال فترات متداخلة، وليس مجموعًا يوميًا. تبقى القياسات المفقودة فارغة. النجوم تقيس الاهتمام لا جودة البرمجيات.
README.md
الأصلAnthropic SDK for Go
The Anthropic SDK for Go provides access to the Claude API from Go applications.
Documentation
Full documentation is available at platform.claude.com/docs/en/api/sdks/go.
Installation
import (
"github.com/anthropics/anthropic-sdk-go/v2" // imported as anthropic
)
Or explicitly add the dependency:
go get -u 'github.com/anthropics/anthropic-sdk-go/[email protected]'
Getting started
package main
import (
"context"
"fmt"
"github.com/anthropics/anthropic-sdk-go/v2"
"github.com/anthropics/anthropic-sdk-go/v2/option"
)
func main() {
client := anthropic.NewClient(
option.WithAPIKey("my-anthropic-api-key"), // defaults to os.LookupEnv("ANTHROPIC_API_KEY")
)
message, err := client.Messages.New(context.TODO(), anthropic.MessageNewParams{
MaxTokens: 1024,
Messages: []anthropic.MessageParam{
anthropic.NewUserMessage(anthropic.NewTextBlock("What is a quaternion?")),
},
Model: anthropic.ModelClaudeOpus5_5,
})
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", message.Content)
}
Requirements
Go 1.25+
Contributing
See CONTRIBUTING.md.
License
This project is licensed under the Apache License, Version 2.0. See the LICENSE file for details. Versions released before the change from the MIT License, and third-party contributions merged before it, remain under the MIT License. See LICENSE-MIT.
استكشف مشاريع مشابهة ومرتبطة
جارٍ التحميل…