Versions in this module Expand all Collapse all v0 v0.1.12 Aug 22, 2024 Changes in this version + const MaxTokensAnthropicSonnet35 + const RoleAssistant + const RoleSystem + const RoleUser + var ErrEmptyResponse = errors.New("no response") + var ErrInvalidContentType = errors.New("invalid content type") + var ErrMissingToken = errors.New(...) + var ErrUnexpectedResponseLength = errors.New("unexpected length of response") + var ErrUnsupportedContentType = errors.New("unsupported content type") + var ErrUnsupportedMessageType = errors.New("unsupported message type") + type LLM struct + CallbacksHandler callbacks.Handler + func New(opts ...Option) (*LLM, error) + func (o *LLM) Call(ctx context.Context, prompt string, options ...llms.CallOption) (string, error) + func (o *LLM) GenerateContent(ctx context.Context, messages []llms.MessageContent, ...) (*llms.ContentResponse, error) + type Option func(*options) + func WithAnthropicBetaHeader(value string) Option + func WithBaseURL(baseURL string) Option + func WithHTTPClient(client anthropicclient.Doer) Option + func WithLegacyTextCompletionsAPI() Option + func WithModel(model string) Option + func WithToken(token string) Option + type ToolResult struct + Content string + ToolUseID string + Type string