Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/antares0982/openaisession
OpenAI session server
https://github.com/antares0982/openaisession
Last synced: 8 days ago
JSON representation
OpenAI session server
- Host: GitHub
- URL: https://github.com/antares0982/openaisession
- Owner: Antares0982
- License: mit
- Created: 2023-04-24T11:08:19.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-11-11T14:06:29.000Z (about 1 month ago)
- Last Synced: 2024-11-11T15:18:17.253Z (about 1 month ago)
- Language: Python
- Size: 88.9 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# OpenAISession
OpenAI session server### API
#### `/api`, methods: `POST`
data format: JSON.
returns: JSON object:
```json
{
"text": "response message",
"token_in": 100,
"token_out": 50
}
```JSON fields:
* `"sid"`: session id, int (required)
* `"msg"`: message to send, string (required)
* `"system_msg"`: system message to override, string (optional, default not to override). If provided, the system message of this session will be replaced by the new message in later API calls.
* `"model"`: model to use, string (optional, default `"GPT4"`). Supported values:
* `"GPT3_5"`
* `"GPT3_5_0301"`
* `"GPT4"`
* `"GPT4_0314"`
* `"GPT4_32K"`
* `"GPT4_32K_0314"`#### `/create`, methods: `POST`
data format: JSON.
returns: the real session id (sid) to use in `/api`.
JSON fields:
* `"sid"` hint `sid`, (optional). If provided and the value is unoccupied, the server returns the value as `sid`. Otherwise, return a new unoccupied `sid`.
* `system_msg`: system message for this session, string (optional, default `"You are a helpful assistant."`)