An open API service indexing awesome lists of open source software.

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

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/chat

Body:
{
"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":"机器人"}
```