Grafana推出了一款Go语言的大语言模型开发工具包[1]。该SDK支持流式文本响应和完整文本生成两种模式,开发者可根据需求选择实时流式响应(StreamText)或等待完整结果(GenerateText)[1]。
这款工具包兼容多个主流AI服务提供商,包括Anthropic、Amazon Bedrock、OpenAI、OpenAI兼容API以及Grafana自有托管端点[1]。SDK还内置了工具调用、结构化输出和多步骤代理功能[1]。在前端集成方面,该SDK提供了React兼容的hooks库,包括useChat、useCompletion、useObject等组件[1]。
为满足生产环境需求,SDK还配备了超时设置、回退机制、日志管理、Prometheus指标导出以及代理可观测性支持[1]。该项目采用Apache License 2.0开源许可证发布[1]。
Grafana has launched a Go language SDK designed for building applications with large language models, featuring support for streaming responses, tool calling, structured output, and multi-step agents [1]. The SDK follows design patterns established by the Vercel AI SDK and integrates with a React frontend library to streamline full-stack AI application development [1].
The toolkit supports multiple AI service providers, including Anthropic, Amazon Bedrock, OpenAI, OpenAI-compatible APIs, and Grafana-hosted endpoints [1]. Developers can choose between StreamText for streaming responses or GenerateText for awaiting complete results [1]. On the frontend, the React library provides hooks such as useChat, useCompletion, and useObject to handle common AI interaction patterns [1].
The SDK includes production-ready features for managing AI workloads at scale, offering configuration options for timeouts, fallbacks, comprehensive logging, Prometheus metrics, and agent observability [1]. Released under the Apache License 2.0, the toolkit is available as open source software [1].