-
-
Notifications
You must be signed in to change notification settings - Fork 9.7k
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
✨ feat: add SenseNova (商汤) model provider #4162
base: main
Are you sure you want to change the base?
Conversation
@hezhijie0327 is attempting to deploy a commit to the LobeHub Pro Team on Vercel. A member of the Team first needs to authorize it. |
Thank you for raising your pull request and contributing to our Community |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #4162 +/- ##
========================================
Coverage 92.21% 92.21%
========================================
Files 493 496 +3
Lines 35390 35710 +320
Branches 3403 3430 +27
========================================
+ Hits 32634 32930 +296
- Misses 2756 2780 +24
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #4162 +/- ##
==========================================
+ Coverage 92.48% 92.49% +0.01%
==========================================
Files 482 484 +2
Lines 34488 34664 +176
Branches 3231 2139 -1092
==========================================
+ Hits 31896 32063 +167
- Misses 2592 2601 +9
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
商汤的话,根据模型和体量,我建议放在零一万物和阶跃星辰中间 |
As for Shangtang, based on the model and volume, I suggest placing it between Zero One Thing and Stepping Stars. |
…top_p` value range
欸 这个等计算 商汤这个非固定 API Key 有点意思 |
Well, wait until the calculation of SenseTime’s non-fixed API Key is a bit interesting |
@LovelyGuYiMeng This model version is a bit ambiguous. Several document information on the official website seems to be out of sync... Since there is an update time in the model square, it has a high degree of acceptance. Currently, this is the main one. https://console.sensecore.cn/help/docs/model-as-a-service/nova/model/llm/GeneralLLM https://platform.sensenova.cn/doc?path=/model/llm/GeneralLLM.md https://console.sensecore.cn/aistudio/plaza?sort=sort_default&page=1&size=24 |
我个人感觉https://platform.sensenova.cn/doc?path=/model/llm/GeneralLLM.md 的正确 |
I personally feel that https://platform.sensenova.cn/doc?path=/model/llm/GeneralLLM.md is correct |
@@ -0,0 +1,34 @@ | |||
import CryptoJS from 'crypto-js'; |
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.
crypto-js 是 Nodejs 的模块吗?
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.
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.
jose 可能会有个问题是不支持 http 协议? 如果直接用 jose 的话感觉可以试试我之前给 zhipu 做的方案:
await LobeZhipuAI.fromAPIKey(params.zhipu);
lobe-chat/src/libs/agent-runtime/zhipu/index.ts
Lines 27 to 46 in b7258b9
static async fromAPIKey({ apiKey, baseURL = DEFAULT_BASE_URL, ...res }: ClientOptions = {}) { | |
const invalidZhipuAPIKey = AgentRuntimeError.createError( | |
AgentRuntimeErrorType.InvalidProviderAPIKey, | |
); | |
if (!apiKey) throw invalidZhipuAPIKey; | |
let token: string; | |
try { | |
token = await generateApiToken(apiKey); | |
} catch { | |
throw invalidZhipuAPIKey; | |
} | |
const header = { Authorization: `Bearer ${token}` }; | |
const llm = new OpenAI({ apiKey, baseURL, defaultHeaders: header, ...res }); | |
return new LobeZhipuAI(llm); | |
} |
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.
jose
走异步,createRuntime
这里方法就调用不了,仅实现了从环境变量生成,暂时回退回去用 crypto-js
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.
为啥要走 createRuntime 呢?之前我给zhipu 初始化就是用的异步方案。 Wenxin 创建独立runtime 是因为它的sdk不支持edge runtime。 如果能用 jose 解决签名问题,感觉没有必要用createRuntime 吧?
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.
哎 有点绕不出来了,没啥思路...
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.
跑通了
…-es`" This reverts commit 9655c92.
💻 变更类型 | Change Type
🔀 变更说明 | Description of Change
frequency_penalty
及top_p
范围[TODO]https://console.sensecore.cn/help/docs/model-as-a-service/nova/chat/ChatCompletions/ChatCompletion[TODO][TODO][Request] 帮忙增加下 SenseChat (SenseNova / SenseCore) 模型 Icon lobe-icons#43a. 输入
AccessKeyID
及AccessKeySecret
,使用:
进行拼接存入apiKey
b. 计算时以
:
进行拆分,并按照官网文档参数进行 JWT 计算,并返回apiKey
c. APIToken 有效期为当前时间的 -5s 至 +1800s,每次对话前会重新计算
Note:
1. 获取临时 TOKEN:https://console.sensecore.cn/iam/Security/private-security2. 创建有效期 TOKEN: https://console.sensecore.cn/help/docs/model-as-a-service/nova/overview/Authorization3.
SenseChat-Vision
不支持 Base64 URL📝 补充信息 | Additional Information
对话
工具调用
多模态
模型列表