-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
92 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
--- | ||
sidebar_position: 3 | ||
title: Agent api | ||
sidebar_label: Agent api | ||
--- | ||
|
||
|
This file was deleted.
Oops, something went wrong.
File renamed without changes.
82 changes: 82 additions & 0 deletions
82
i18n/zh-Hans/docusaurus-plugin-content-docs/current/APIDocs/agent_api.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
--- | ||
sidebar_position: 3 | ||
title: Agent API | ||
sidebar_label: Agent API | ||
--- | ||
|
||
## 公共聊天 API | ||
|
||
**POST** `https://gateway.neolink-ai.com/byoa/api/v1/agents/chat_public` | ||
|
||
### API 描述 | ||
|
||
当用户的 Agent 发布后,可以通过调用此接口进行聊天会话。 | ||
|
||
### 请求参数 | ||
|
||
|参数 |类型 | 说明 | | ||
|------------------|----------|---------| | ||
|deploy_url_suffix |string | agent_id | | ||
|messages |json | 请求的内容 | | ||
|
||
|
||
### 示例 | ||
|
||
- 非流式请求 | ||
|
||
```python | ||
import requests | ||
|
||
url = "https://gateway.neolink-ai.com/byoa/api/v1/agents/chat_public" | ||
|
||
data = { | ||
"deploy_url_suffix": "BMZOzoDkpnpuQGplVtXAIaYuCouGivRAvdn29xxxx", | ||
"messages": [ | ||
{ | ||
"role": "user", | ||
"content": "hello!" | ||
}, | ||
{ | ||
"role": "assistant", | ||
"content": "Hello, how can I help you?" | ||
}, | ||
{ | ||
"role": "user", | ||
"content": "中国奥运会是哪年举行的?" | ||
} | ||
] | ||
} | ||
|
||
response = requests.post(url, json=data) | ||
print(response.text) | ||
``` | ||
|
||
- 流式请求 | ||
|
||
```python | ||
import requests | ||
|
||
url = "https://gateway.neolink-ai.com/byoa/api/v1/agents/chat_public" | ||
|
||
data = { | ||
"deploy_url_suffix": "BMZOzoDkpnpuQGplVtXAIaYuCouGivRAvdn29xxxx", | ||
"messages": [ | ||
{ | ||
"role": "user", | ||
"content": "hello!" | ||
}, | ||
{ | ||
"role": "assistant", | ||
"content": "Hello, how can I help you?" | ||
}, | ||
{ | ||
"role": "user", | ||
"content": "请生成一篇800字的高考作文" | ||
} | ||
] | ||
} | ||
|
||
response = requests.post(url, json=data, stream=True) | ||
for line in response.iter_lines(): | ||
print(line.decode("utf-8")) | ||
``` |
8 changes: 0 additions & 8 deletions
8
i18n/zh-Hans/docusaurus-plugin-content-docs/current/APIDocs/power-api/_category_.json
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters