mirror of
https://github.com/LLM-Red-Team/kimi-free-api.git
synced 2024-12-22 21:29:20 +08:00
支持kimi+智能体调用
This commit is contained in:
parent
6105410dd2
commit
889c874264
11
README.md
11
README.md
@ -11,7 +11,7 @@
|
|||||||
![](https://img.shields.io/github/forks/llm-red-team/kimi-free-api.svg)
|
![](https://img.shields.io/github/forks/llm-red-team/kimi-free-api.svg)
|
||||||
![](https://img.shields.io/docker/pulls/vinlic/kimi-free-api.svg)
|
![](https://img.shields.io/docker/pulls/vinlic/kimi-free-api.svg)
|
||||||
|
|
||||||
支持高速流式输出、支持多轮对话、支持联网搜索、支持长文档解读、支持图像解析,零配置部署,多路token支持,自动清理会话痕迹。
|
支持高速流式输出、支持多轮对话、支持联网搜索、支持智能体对话、支持长文档解读、支持图像解析,零配置部署,多路token支持,自动清理会话痕迹。
|
||||||
|
|
||||||
与ChatGPT接口完全兼容。
|
与ChatGPT接口完全兼容。
|
||||||
|
|
||||||
@ -85,6 +85,12 @@ https://udify.app/chat/Po0F6BMJ15q5vu2P
|
|||||||
|
|
||||||
![联网搜索](./doc/example-2.png)
|
![联网搜索](./doc/example-2.png)
|
||||||
|
|
||||||
|
### 智能体对话Demo
|
||||||
|
|
||||||
|
此处使用 [翻译通](https://kimi.moonshot.cn/chat/coo6l3pkqq4ri39f36bg) 智能体。
|
||||||
|
|
||||||
|
![智能体对话](./doc/example-7.png)
|
||||||
|
|
||||||
### 长文档解读Demo
|
### 长文档解读Demo
|
||||||
|
|
||||||
![长文档解读](./doc/example-5.png)
|
![长文档解读](./doc/example-5.png)
|
||||||
@ -269,7 +275,8 @@ Authorization: Bearer [refresh_token]
|
|||||||
请求数据:
|
请求数据:
|
||||||
```json
|
```json
|
||||||
{
|
{
|
||||||
// 模型名称随意填写,如果不希望输出检索过程模型名称请包含silent_search
|
// model随意填写,如果不希望输出检索过程模型名称请包含silent_search
|
||||||
|
// 如果使用kimi+智能体,model请填写智能体ID,就是浏览器地址栏上尾部的一串英文+数字20个字符的ID
|
||||||
"model": "kimi",
|
"model": "kimi",
|
||||||
// 目前多轮对话基于消息合并实现,某些场景可能导致能力下降且受单轮最大Token数限制
|
// 目前多轮对话基于消息合并实现,某些场景可能导致能力下降且受单轮最大Token数限制
|
||||||
// 如果您想获得原生的多轮对话体验,可以传入首轮消息获得的id,来接续上下文,注意如果使用这个,首轮必须传none,否则第二轮会空响应!
|
// 如果您想获得原生的多轮对话体验,可以传入首轮消息获得的id,来接续上下文,注意如果使用这个,首轮必须传none,否则第二轮会空响应!
|
||||||
|
BIN
doc/example-7.png
Normal file
BIN
doc/example-7.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 44 KiB |
@ -262,6 +262,7 @@ async function createCompletion(model = MODEL_NAME, messages: any[], refreshToke
|
|||||||
} = await acquireToken(refreshToken);
|
} = await acquireToken(refreshToken);
|
||||||
const sendMessages = messagesPrepare(messages, !!refConvId);
|
const sendMessages = messagesPrepare(messages, !!refConvId);
|
||||||
const result = await axios.post(`https://kimi.moonshot.cn/api/chat/${convId}/completion/stream`, {
|
const result = await axios.post(`https://kimi.moonshot.cn/api/chat/${convId}/completion/stream`, {
|
||||||
|
kimiplus_id: /^[0-9a-z]{20}$/.test(model) ? model : undefined,
|
||||||
messages: sendMessages,
|
messages: sendMessages,
|
||||||
refs,
|
refs,
|
||||||
use_search: useSearch
|
use_search: useSearch
|
||||||
@ -338,6 +339,7 @@ async function createCompletionStream(model = MODEL_NAME, messages: any[], refre
|
|||||||
} = await acquireToken(refreshToken);
|
} = await acquireToken(refreshToken);
|
||||||
const sendMessages = messagesPrepare(messages, !!refConvId);
|
const sendMessages = messagesPrepare(messages, !!refConvId);
|
||||||
const result = await axios.post(`https://kimi.moonshot.cn/api/chat/${convId}/completion/stream`, {
|
const result = await axios.post(`https://kimi.moonshot.cn/api/chat/${convId}/completion/stream`, {
|
||||||
|
kimiplus_id: /^[0-9a-z]{20}$/.test(model) ? model : undefined,
|
||||||
messages: sendMessages,
|
messages: sendMessages,
|
||||||
refs,
|
refs,
|
||||||
use_search: useSearch
|
use_search: useSearch
|
||||||
|
Loading…
Reference in New Issue
Block a user