View Source Omni.Providers.Anthropic (Omni v0.1.0)
Provider implementation for the Anthropic Messages API. Use this Provider to chat with any of the Claude 3 models.
Authorization
Obtain an API key from the Anthropic Developer Console
and add it to your application's config.exs
:
config :omni, Omni.Providers.Anthropic, "sk-ant-api-notarealkey"
Alternatively, pass the API key to Onmi.init/2
:
iex> Omni.init(:anthropic, api_key: api_key)
%Omni.Provider{mod: Omni.Providers.Anthropic, req: %Req.Request{}}
Summary
Functions
Returns the schema for this Provider.
Schema
:model
(String.t/0
) - Required. The model that will complete your prompt.:messages
(list ofmap/0
) - Required. Input messages.:max_tokens
(integer/0
) - The maximum number of tokens to generate before stopping. The default value is4096
.:metadata
(map/0
) - A map describing metadata about the request.:user_id
(String.t/0
) - An external identifier for the user who is associated with the request.
:stop_sequences
(list ofString.t/0
) - Custom text sequences that will cause the model to stop generating.:stream
(boolean/0
) - Whether to incrementally stream the response using server-sent events.:system
(String.t/0
) - System prompt.:temperature
(float/0
) - Amount of randomness injected into the response.:tools
(list ofmap/0
) - A list of tools the model may call.:tool_choice
(map/0
) - How to use the provided tools.:type
- Required. How the model should use the provided tools.:name
(String.t/0
) - The name of the tool to use.
:top_k
(integer/0
) - Only sample from the top K options for each subsequent token.:top_p
(float/0
) - Amount of randomness injected into the response.