-
Notifications
You must be signed in to change notification settings - Fork 820
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
适配讯飞星火4.0模型,新增讯飞星火自定义prompt功能 #239
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
完成以上 review 的反馈后,我将快速合并
src/xunfei/xunfei.js
Outdated
{ role: 'assistant', content: '你是一个专业的智能助手' }, //# AI的历史回答结果 | ||
// { role: 'user', content: '你是谁' }, //# 用户的历史问题 | ||
{ role: 'system', content: prompt }, //# 自行设定的prompt | ||
// { role: 'assistant', content: '你是一个专业的智能助手' }, //# AI的历史回答结果 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这里做一下兼容处理,如果没填自定义 prompt 还用之前的
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
prompt已做处理
src/xunfei/xunfei.js
Outdated
@@ -10,7 +10,10 @@ const appID = env.XUNFEI_APP_ID | |||
const apiKey = env.XUNFEI_API_KEY | |||
const apiSecret = env.XUNFEI_API_SECRET | |||
// 地址必须填写,代表着大模型的版本号!!!!!!!!!!!!!!!! | |||
const httpUrl = new URL('https://spark-api.xf-yun.com/v3.5/chat') | |||
const httpUrl = new URL('https://spark-api.xf-yun.com/v4.0/chat') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
是不是现在将版本号放到 env 里去配置更好,因为默认的会导致部分用户不看代码,不知道为什么匹配不上模型
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
已修改,.env里面也有说明
No description provided.