anthropic

package
v0.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 16, 2026 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultLLMModel = "claude-3-sonnet-20240229"

DefaultLLMModel is the default Anthropic model when none is specified.

Variables

This section is empty.

Functions

This section is empty.

Types

type Service

type Service struct {
	// contains filtered or unexported fields
}

Service implements a minimal Anthropic messages API client compatible with services.LLMService.

func NewLLMService

func NewLLMService(apiKey, model string) *Service

NewLLMService creates a new Anthropic LLM service. apiKey should be the Anthropic API key; model is the messages model (e.g. "claude-3-sonnet-20240229").

func (*Service) Chat

func (s *Service) Chat(ctx context.Context, messages []map[string]any, onToken func(*frames.LLMTextFrame)) error

Chat runs a completion using Anthropic's messages API. For now this sends a single aggregated text frame with the full response (no incremental token streaming).

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL