https://github.com/veasion/internlm_chat_http_api
http api for internlm
https://github.com/veasion/internlm_chat_http_api
internlm
Last synced: 7 months ago
JSON representation
http api for internlm
- Host: GitHub
- URL: https://github.com/veasion/internlm_chat_http_api
- Owner: veasion
- Created: 2023-08-23T01:56:01.000Z (about 2 years ago)
- Default Branch: master
- Last Pushed: 2024-02-27T13:03:23.000Z (over 1 year ago)
- Last Synced: 2025-01-22T20:28:28.409Z (9 months ago)
- Topics: internlm
- Language: Python
- Homepage:
- Size: 11.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
书生:https://github.com/InternLM/InternLM
HTTP API 接口 支持流式和非流式请求。
运行命令:
前台进程运行: python internlm_api.py
后台进程运行: python internlm_api.py > api.log 2>&1 &
接口文档:
```
POST http://127.0.0.1:8002/internlm/chatBody:
{
"message": [
{
"role": "user",
"content": "你好"
},
{
"role": "assistant",
"content": "您好,请问有什么可以帮您?"
},
{
"role": "user",
"content": "你是谁?"
}
],
"stream": false,
"top_p": 0.8,
"temperature": 0.7,
"max_tokens": 2048
}Response for not stream:
{
"code": 0,
"data": {
"content": "我是AI机器人"
},
"message": "success"
}Response for stream:
data: {"content":"我"}data: {"content":"是"}
data: {"content":"AI"}
data: {"content":"机器人"}
```