[Feature Request] 如何调用讯飞和百度的deepseek模型
🥰 需求描述
目前讯飞deepseek的api是免费使用的,对比了一堆云之后发现百度的api是目前看下来最便宜的。所以想试着调用这两个平台的deepseek。
🧐 解决方案
想知道如何调用这两个平台的api
📝 补充信息
这是目前参考#6204做的填的,但是失败了,显示
{
"error": true,
"message": "Failed to fetch"
}
似乎是模型名的问题,但是不清楚模型名该怎么填
这是根据讯飞官方文档写的调用api的代码:
def chat(self, message): # r1
self.add_message("user", message)
model = "xdeepseekv3"
try:
response = self.client.chat.completions.create(
model= model,
messages= self.conversation_history,
stream=True,
temperature=0.7,
max_tokens=4096,
extra_headers={"lora_id": "0"},
stream_options={"include_usage": True}
)
这是讯飞的接口信息:
Bot detected the issue body's language is not English, translate it automatically.
Title: [Feature Request] How to call iFlytek and Baidu's deepseek model
同问,调用通义千问deepseek返回一样的提示
Bot detected the issue body's language is not English, translate it automatically.
The same question is called Tongyi Qianwen deepseek to return the same prompt
遇上同样的问题
Bot detected the issue body's language is not English, translate it automatically.
Encountered the same problem
chrome 可以检查到你访问的具体 api url,目前感觉 url 的拼接有一些问题,你只需要自己修改一下代码的 constant.ts 文件中过加入对一个模型名称即可。
我这里加入了火山引擎的 deepseek 模型,由于火山的endpoint较为工整,我只需要加入模型名称。