Create a YAML file, for example, user_claude.yaml Paste the following content into your user_claude.yaml file.
name: 'user_claude_llm'
description: 'user claude llm with spi'
model_name: 'claude-3-opus-20240229'
max_tokens: 4096
metadata:
type: 'LLM'
module: 'agentuniverse.llm.default.claude_llm'
class: 'ClaudeLLM'
Must be configured: ANTHROPIC_API_KEY
Optional: ANTHROPIC_API_URL
import os
os.environ['ANTHROPIC_API_KEY'] = 'sk-***'
os.environ['ANTHROPIC_API_URL'] = 'https://xxxxxx'
In the custom_key.toml file under the config directory of the project, add the configuration:
ANTHROPIC_API_KEY="sk-******"
ANTHROPIC_API_URL="https://xxxxxx"
Reference Claude Official Documentation: https://docs.anthropic.com/zh-CN/docs/getting-access-to-claude
In agentuniverse, we have already created an llm with the name default_claude_llm. After configuring the ANTHROPIC_API_KEY, users can directly use it.