LemonAi.Providers.Anthropic (lemon_ai v0.1.0)

View Source

Anthropic Messages API provider implementation.

Implements the LemonAi.Provider behaviour for streaming responses from Anthropic's Claude models via the Messages API.

Features

  • Server-Sent Events (SSE) streaming
  • Content blocks: text, thinking, tool_use
  • Token usage tracking
  • Prompt caching support

Configuration

The API key can be provided via:

  • api_key option in StreamOptions
  • ANTHROPIC_API_KEY environment variable