Licensed to be used in conjunction with basebox, only.
Create Chat Completion
Requests an AI response for the given chat conversation.
Request body field usage differs slightly from the original API spec.
Request Body
messages
An array of message objects that comprises the entire conversation so far.
The message object is defined as follows:
model
Application ID of the basebox app you want to process the request.
Default: ai.basebox.assistant
Example:
The application ID of an app is currently only displayed in the URL field of the browser.
Example URL: https://soccer.kiste.ai/apps/ai.basebox.soccer.5ca2b0ac-f3f9-45b6-9a2e-1a721dc9b86
Application ID: ai.basebox.soccer.5ca2b0ac-f3f9-45b6-9a2e-1a721dc9b862
audio
Not supported yet
frequency_penalty
Not supported yet
Other fields
Other fields are not supported, as their purpose is defined in the basebox app being called.
Response Body
A JSON object that contains the chunked response from the basebox app. See example below.
TODO: Document response object
curl Example
api_key="<API_TOKEN>"
host="https://aims.basebox.ai"
curl -v $host/rest/v1/chat/completions \
-H "Content-Type: application/json" \
-H "x-realm: localhost" \
-H "Authorization: Bearer $api_key" \
-d '{
"model": "ai.basebox.assistant",
"stream": true,
"messages": [
{
"role": "user",
"content": "Hello! Are you good?"
}
]
}'
Response
{"type":"message_start","message":{"usage":{"input_tokens":91,"output_tokens":5}}}
{"type":"Other"}
{"type":"Other"}
{"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"Hello! I'm doing"}}
{"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":" well, thank you for"}}
{"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":" asking! I'm here"}}
{"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":" and ready to help with"}}
{"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":" whatever you need. How"}}
{"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":" are you doing today?"}}
{"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":" Is there anything I can assist you with?"}}
{"type":"Other"}
{"type":"message_delta","usage":{"input_tokens":null,"output_tokens":42},"delta":{"stop_reason":"end_turn","stop_sequence":null}}
{"type":"Other"}