Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

A Go implementation of Vercel's AI SDK Data Stream Protocol.

License

NotificationsYou must be signed in to change notification settings

coder/aisdk-go

Repository files navigation

GitHub ReleaseGoDocCI Status

Warning

This library is super new and may change a lot.

A Go implementation of Vercel's AI SDKData Stream Protocol.

  • Supports OpenAI, Google, and Anthropic (with Bedrock support)
  • Examples for integratinguseChat
  • Chain tool usage in Go, just likemaxSteps
// frontend.tsxconst{ messages}=useChat({// Points to our Go backend!api:"/api/chat",})
// backend.go// Accept the POST request...varreq*aisdk.Chatmessages,err:=aisdk.MessagesToOpenAI(req.Messages)iferr!=nil {http.Error(w,err.Error(),http.StatusInternalServerError)return}// Convert the http.ResponseWriter to a Data Stream.dataStream:=aisdk.NewDataStream(w)stream:=openaiClient.Chat.Completions.NewStreaming(...)aisdk.PipeOpenAIToDataStream(stream,dataStream)

Development

Run tests withgo test. Start theuseChat demo with:

# any or all of these can be setexport OPENAI_API_KEY=<api-key>export ANTHROPIC_API_KEY=<api-key>export GOOGLE_API_KEY=<api-key>cd demobun ibun dev

About

A Go implementation of Vercel's AI SDK Data Stream Protocol.

Topics

Resources

License

Code of conduct

Security policy

Stars

Watchers

Forks

Packages

No packages published

Contributors5

Languages


[8]ページ先頭

©2009-2025 Movatter.jp