Skip to content
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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

printlndarling
Copy link

No description provided.

Copy link
Owner

@wangrongding wangrongding left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

完成以上 review 的反馈后,我将快速合并

{ role: 'assistant', content: '你是一个专业的智能助手' }, //# AI的历史回答结果
// { role: 'user', content: '你是谁' }, //# 用户的历史问题
{ role: 'system', content: prompt }, //# 自行设定的prompt
// { role: 'assistant', content: '你是一个专业的智能助手' }, //# AI的历史回答结果
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这里做一下兼容处理,如果没填自定义 prompt 还用之前的

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

prompt已做处理

@@ -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')
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

是不是现在将版本号放到 env 里去配置更好,因为默认的会导致部分用户不看代码,不知道为什么匹配不上模型

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

已修改,.env里面也有说明

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants