Anthropic’s Claude API has a distinct structure and accepts only specific parameters. This documentation explains how to configure and use the call_llm_anthropic function through the LLMConfig system in llmworkbook.
call_llm_anthropic)Configuration Keys in options:
model
strExample Values:
"claude-3-opus-20240229""claude-3-sonnet-20240229""claude-3-haiku-20240307""claude-3-sonnet-20240229" (if not explicitly set)max_tokens
intsystem_prompt
stroptions)system=... in API call.from llmworkbook import LLMConfig
config = LLMConfig(
provider="anthropic",
system_prompt="You are a helpful assistant.",
options={
"model": "claude-3-haiku-20240307",
"max_tokens": 512,
}
)
api_key
Your Anthropic API key can be:
config.api_key, orANTHROPIC_API_KEY.