跳到主要内容
版本:v6.5.0

调用大模型

命令说明

调用大模型回答问题或对自然语言进行处理

命令原型

LLM.GeneralChat({},"","","",30,0.7,4000)

命令参数

参数必选类型默认值说明
modelTruestring""模型名称
base_urlTruestring""模型访问地址
api_keyTruestring""API秘钥
contenttruestring""用户提示词
promptfalsestring""系统提示词
file_pathfalsestring""图片路径 (JPEG/PNG/BMP,最大10MB,部分模型不一定三种格式图片都支持)
timeoutfalseint30s超时时间(秒)
temperaturefalseint0.7温度
max_output_lengthfalseint4000最大输出长度(token)

运行实例

/***************************输入文本**********************************
命令原型:
LLM.GeneralChat({},"","","",30,0.7,4000)
入参:
model -- 模型名称
base_url-- 模型访问地址
api_key --API秘钥
content--|用户提示词
prompt --系统提示词
file_path --图片路径 (JPEG/PNG/BMP,最大10MB,部分模型不一定三种格式图片都支持)
timeout--超时时间(秒)
temperature-- 温度
max_output_length --最大输出长度(token)
出参:
sRet--命令运行的结果赋值给此变量
注意事项:
删除大模型的环境变量配置文件或在大模型配置管理界面中删除已调用的大模型,命令将无法正常运行
*********************************************************************/
LLM.GeneralChat({"name":"deepseek","model":"openai/deepseek-chat","api_key":"$ENV.deepseek_api_key","base_url":"https://api.deepseek.com"},"帮我将hello翻译成中文","","",30,0.7,4000)

可视化样例