mirror of
https://github.com/ikechan8370/chatgpt-plugin.git
synced 2025-12-17 13:57:10 +00:00
适配星火v3 (#598)
* fix: 修复星火api上下文 * 将无星火ck的情况降低为warn * feat: 添加星火设定自定义代码功能 * 修复星火api模式的一些问题 * 修复导出配置问题 * feat:添加工具箱快捷登录接口 * 添加工具箱快捷登录指令 * 阻止群聊使用快捷登录 * 添加Azure配置支持,修复重复的配置项冲突 * 移除旧版本渲染和新版本帮助 * 添加工具箱 * 更新工具箱替换原有后台 * 更新工具箱适配代码 * 后台适配Trss * 修复trss不支持sendPrivateMsg的问题 * 优化路由 * 修复路由 * 适配其他uin * 添加bing第三方绘图 * 修复bing绘图第三方调用错误 * 添加bing第三方绘图采样配置 * 修复错误 * 添加bing第三方绘图图片大小配置 * 修复视图错误 * 使用ap替换第三方绘图 * 适配trss * server 适配trss * 修复错误的后台版本更新 * 添加锅巴用户数据 * 修复server初始化消息错误 * 添加锅巴插件适配 * 更新后台页面 * 添加锅巴代理接口 * 优化锅巴接口代理 * 修复锅巴代理参数 * 删除调试信息 * 修复headers * 更新后台锅巴插件支持 * 适配星火v3 * 适配星火v3 * 修复星火domain错误
This commit is contained in:
parent
c0936e6e2a
commit
b7376407af
2 changed files with 13 additions and 3 deletions
|
|
@ -718,6 +718,10 @@
|
||||||
"label": "讯飞星火认知大模型V2.0",
|
"label": "讯飞星火认知大模型V2.0",
|
||||||
"value": "apiv2"
|
"value": "apiv2"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"label": "讯飞星火认知大模型V3.0",
|
||||||
|
"value": "apiv3"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"label": "讯飞星火助手",
|
"label": "讯飞星火助手",
|
||||||
"value": "assistants"
|
"value": "assistants"
|
||||||
|
|
|
||||||
|
|
@ -90,6 +90,8 @@ export default class XinghuoClient {
|
||||||
let APILink = '/v1.1/chat'
|
let APILink = '/v1.1/chat'
|
||||||
if (Config.xhmode == 'apiv2') {
|
if (Config.xhmode == 'apiv2') {
|
||||||
APILink = '/v2.1/chat'
|
APILink = '/v2.1/chat'
|
||||||
|
} else if (Config.xhmode == 'apiv3') {
|
||||||
|
APILink = '/v3.1/chat'
|
||||||
}
|
}
|
||||||
const date = new Date().toGMTString()
|
const date = new Date().toGMTString()
|
||||||
const algorithm = 'hmac-sha256'
|
const algorithm = 'hmac-sha256'
|
||||||
|
|
@ -179,7 +181,11 @@ export default class XinghuoClient {
|
||||||
// 获取ws链接
|
// 获取ws链接
|
||||||
const wsUrl = Config.xhmode == 'assistants' ? Config.xhAssistants : await this.getWsUrl()
|
const wsUrl = Config.xhmode == 'assistants' ? Config.xhAssistants : await this.getWsUrl()
|
||||||
if (!wsUrl) throw new Error('缺少依赖:crypto。请安装依赖后重试')
|
if (!wsUrl) throw new Error('缺少依赖:crypto。请安装依赖后重试')
|
||||||
|
let domain = 'general'
|
||||||
|
if (Config.xhmode == 'apiv2')
|
||||||
|
domain = "generalv2"
|
||||||
|
else if (Config.xhmode == 'apiv3')
|
||||||
|
domain = "generalv3"
|
||||||
// 编写消息内容
|
// 编写消息内容
|
||||||
const wsSendData = {
|
const wsSendData = {
|
||||||
header: {
|
header: {
|
||||||
|
|
@ -188,7 +194,7 @@ export default class XinghuoClient {
|
||||||
},
|
},
|
||||||
parameter: {
|
parameter: {
|
||||||
chat: {
|
chat: {
|
||||||
domain: Config.xhmode == 'api' ? "general" : "generalv2",
|
domain: domain,
|
||||||
temperature: Config.xhTemperature, // 核采样阈值
|
temperature: Config.xhTemperature, // 核采样阈值
|
||||||
max_tokens: Config.xhMaxTokens, // tokens最大长度
|
max_tokens: Config.xhMaxTokens, // tokens最大长度
|
||||||
chat_id: chatId,
|
chat_id: chatId,
|
||||||
|
|
@ -378,7 +384,7 @@ export default class XinghuoClient {
|
||||||
let chatId = option?.chatId
|
let chatId = option?.chatId
|
||||||
let image = option?.image
|
let image = option?.image
|
||||||
|
|
||||||
if (Config.xhmode == 'api' || Config.xhmode == 'apiv2' || Config.xhmode == 'assistants') {
|
if (Config.xhmode == 'api' || Config.xhmode == 'apiv2' || Config.xhmode == 'apiv3' || Config.xhmode == 'assistants') {
|
||||||
if (!Config.xhAppId || !Config.xhAPISecret || !Config.xhAPIKey) throw new Error('未配置api')
|
if (!Config.xhAppId || !Config.xhAPISecret || !Config.xhAPIKey) throw new Error('未配置api')
|
||||||
let Prompt = []
|
let Prompt = []
|
||||||
// 设定
|
// 设定
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue