Create a YAML file, for example, user_claude.yaml Paste the following content into your user_claude.yaml file.
name: 'user_baichuan_llm'
description: 'user baichuan llm with spi'
model_name: 'Baichuan2-Turbo'
max_tokens: 1000
max_context_length: The maximum length of context
metadata:
type: 'LLM'
module: 'agentuniverse.llm.default.baichuan_openai_style_llm'
class: 'BAICHUANOpenAIStyleLLM'
Must be configured: BAICHUAN_API_KEY
Optional: BAICHUAN_API_BASE, BAICHUAN_PROXY
import os
os.environ['BAICHUAN_API_KEY'] = 'sk-***'
os.environ['BAICHUAN_PROXY'] = 'https://xxxxxx'
In the custom_key.toml file under the config directory of the project, add the configuration:
BAICHUAN_API_KEY="sk-******"
BAICHUAN_PROXY="https://xxxxxx"
Reference BaiChuan Official Documentation: https://platform.baichuan-ai.com/console/apikey
In agentuniverse, we have already created an llm with the name default_baichuan_llm. After configuring the BAICHUAN_API_KEY, users can directly use it.