Versions in this module Expand all Collapse all v0 v0.0.2 Jun 21, 2024 Changes in this version + const MODEL_CLAUDE_35_SONNET v0.0.1 Mar 21, 2024 Changes in this version + const DEFAULT_ANTHROPIC_BASE_URL + const MODEL_CLAUDE_2_1 + const MODEL_CLAUDE_3_HAIKU + const MODEL_CLAUDE_3_OPUS + const MODEL_CLAUDE_3_SONNET + const SSE_DATA_PREFIX + const SSE_EVENT_BLOCK_DELTA + const SSE_EVENT_CONTENT_BLOCK_START + const SSE_EVENT_CONTENT_BLOCK_STOP + const SSE_EVENT_ERROR + const SSE_EVENT_MESSAGE_DELTA + const SSE_EVENT_MESSAGE_START + const SSE_EVENT_MESSAGE_STOP + const SSE_EVENT_PING + const SSE_EVENT_PREFIX + var ANTHROPIC_API_KEY = getEnv("ANTHROPIC_API_KEY", "") + var ANTHROPIC_BASE_URL = getEnv("ANTHROPIC_BASE_URL", DEFAULT_ANTHROPIC_BASE_URL) + type Client struct + func NewClient(opts ...ClientOptions) *Client + func (c *Client) CreateMessages(mr MessagesRequest) (*MessagesResponse, error) + func (c *Client) CreateMessagesStream(mr MessagesRequest) (*MessagesStream, error) + type ClientOptions struct + ApiKey string + BaseUrl string + type Message struct + Content []MessageContent + Role string + type MessageContent interface + GetType func() string + type MessageContentFile struct + Source MessageContentFileSource + Type string + func (m *MessageContentFile) GetType() string + type MessageContentFileSource struct + Data string + MediaType string + Type string + type MessageContentText struct + Text string + Type string + func (m *MessageContentText) GetType() string + type MessagesRequest struct + MaxTokens int + Messages []Message + Metadata struct{ ... } + Model string + StopSequences []string + Stream bool + System string + Temperature float64 + TopK int + TopP float64 + type MessagesResponse struct + Content []MessageContentText + ID string + Model string + Role string + StopReaon string + StopSequence string + Type string + Usage struct{ ... } + type MessagesResponseError struct + Error struct{ ... } + Type string + type MessagesStream struct + type MessagesStreamReader struct + func (s *MessagesStreamReader) Close() + func (s *MessagesStreamReader) Recv() (*MessagesStreamResponse, error) + type MessagesStreamResponse struct + ContentBlock MessagesStreamResponseContentBlock + Delta MessagesStreamResponseDelta + Error struct{ ... } + Index int + Message MessagesResponse + Type string + type MessagesStreamResponseContentBlock struct + Text string + Type string + type MessagesStreamResponseDelta struct + StopReaon string + StopSequence string + Text string + Type string + Usage struct{ ... }