View Source Anthropic.Config (anthropic_community v0.4.3)

Module provides struct for Anthropic.Config, and provides validations for various config options.

Configuration

The following configuration options are available:

  • :api_key - The API key for authenticating requests to the Anthropic API (required).
  • :model - The name of the model to use for generating responses (default: "claude-3-opus-20240229").
  • :max_tokens - The maximum number of tokens allowed in the generated response (default: 1000).
  • :temperature - The sampling temperature for controlling response randomness (default: 1.0).
  • :top_p - The cumulative probability threshold for nucleus sampling (default: 1.0).
  • :top_k - The number of top tokens to consider for sampling (default: 1).
  • :anthropic_version - The version of the Anthropic API to use (default: "2023-06-01").
  • :api_url - The URL of the Anthropic API (default: "https://api.anthropic.com/v1").

These options can be set in your application's configuration file:

config :anthropic,
  api_key: "your_api_key",
  model: "claude-v1",
  max_tokens: 500,
  temperature: 0.7,
  top_p: 0.9,
  top_k: 5

Summary

Types

@type config_option() ::
  {:anthropic_version, String.t()}
  | {:api_url, String.t()}
  | {:api_key, String.t()}
@type config_options() :: [config_option()]
@type t() :: %Anthropic.Config{
  anthropic_version: String.t(),
  api_key: String.t(),
  api_url: String.t()
}

Functions

Link to this function

build_system_configs(opts)

View Source
@spec create(keyword()) :: struct()