anthropic-sdk-go  by anthropics

Go SDK for Anthropic Claude models

Created 1 year ago
581 stars

Top 55.7% 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

13 hours ago

Responsiveness

1 day

Pull Requests (30d)
6
Issues (30d)
2
Star History
47 stars in the last 30 days

Explore Similar Projects

Feedback? Help us improve.