Create a YAML file, for example, user_qwen.yaml Paste the following content into your user_qwen.yaml file.
name: 'user_qwen_llm'
description: 'user qwen llm with spi'
model_name: 'qwen-turbo'
max_tokens: 1000
metadata:
type: 'LLM'
module: 'agentuniverse.llm.default.qwen_openai_style_llm'
class: 'QWenOpenAIStyleLLM'
Must be configured:DASHSCOPE_API_KEY
Optional: DASHSCOPE_PROXY
import os
os.environ['DASHSCOPE_API_KEY'] = 'sk-***'
os.environ['DASHSCOPE_PROXY'] = 'https://xxxxxx'
In the custom_key.toml file under the config directory of the project, add the configuration:
DASHSCOPE_API_KEY="sk-******"
DASHSCOPE_PROXY="https://xxxxxx"
Reference Dashscope Official Documentation:https://dashscope.console.aliyun.com/apiKey
In agentuniverse, we have already created an llm with the name default_qwen_llm. After configuring the DASHSCOPE_API_KEY, users can directly use it.