anthropic-sdk-go  by anthropics

Go SDK for Anthropic Claude models

created 1 year ago
462 stars

Top 66.5% on sourcepulse

GitHubView on GitHub
Project Summary

This Go SDK provides a convenient interface for interacting with Anthropic's AI models, targeting Go developers building applications that leverage large language models. It simplifies API calls for text generation, conversation management, and tool usage, enabling developers to integrate advanced AI capabilities into their Go projects.

How It Works

The SDK utilizes a client-server model, abstracting the underlying REST API calls. It employs Go's functional options pattern for configuring requests, allowing for flexible customization of headers, timeouts, retries, and more. The library handles request serialization and response deserialization, mapping API responses to idiomatic Go structs. It also supports streaming responses for long-running requests and provides robust error handling for API-specific errors.

Quick Start & Requirements

  • Installation: go get -u 'github.com/anthropics/anthropic-sdk-go'
  • Requirements: Go 1.18+
  • Usage: See the API documentation for detailed examples.

Highlighted Details

  • Supports message creation, conversation history, system prompts, and streaming.
  • Implements tool calling with JSON schema generation and execution.
  • Offers detailed control over request parameters, including optional fields and unions.
  • Provides utilities for pagination, error handling, and accessing raw response data.

Maintenance & Community

The project is maintained by Anthropic. Community engagement and feedback are encouraged via GitHub issues.

Licensing & Compatibility

The SDK is likely distributed under a permissive license, allowing for commercial use and integration with closed-source applications. Specific license details should be confirmed in the repository.

Limitations & Caveats

The README notes a recent breaking change in the package design, recommending users consult a migration guide. Long-running, non-streaming requests may encounter timeouts or be rejected by the SDK if not handled with streaming or custom timeouts.

Health Check
Last commit

10 hours ago

Responsiveness

1 day

Pull Requests (30d)
9
Issues (30d)
8
Star History
183 stars in the last 90 days

Explore Similar Projects

Starred by Patrick von Platen Patrick von Platen(Core Contributor to Hugging Face Transformers and Diffusers) and Jeff Hammerbacher Jeff Hammerbacher(Cofounder of Cloudera).

client-python by mistralai

0.3%
628
Python SDK for Mistral AI platform
created 1 year ago
updated 1 week ago
Starred by Adam Wolff Adam Wolff(Claude Code Core; MTS at Anthropic), Samuel Colvin Samuel Colvin(Author of Pydantic, Pydantic Logfire, PydanticAI), and
3 more.

anthropic-sdk-python by anthropics

0.6%
2k
Python SDK for Anthropic's REST API
created 2 years ago
updated 10 hours ago
Feedback? Help us improve.