Completions
Create completions based on provided messages or prompt and sources.
Completions endpoint is used in scenarios where you need to generate text based on a given context, either provided through a conversation history (messages) or a specific starting prompt. The sources parameter helps to contextualize the completion by specifying the indexes to use.
The response should look something like this:
Body Parameters:
Name | Type | Description | Required |
---|---|---|---|
messages | array | An array of message objects. Each message object contains a role and content. This simulates a conversation history. | Yes (or |
prompt | string | A string prompt to generate completions. This is used when there are no prior messages to base the completion on. | Yes (or |
sources | array | An array of strings representing index ID or DID to be used as a source for generating completions. | Yes |
Note: Either messages
or prompt
must be provided, along with sources
.
Example Request Body
Using Messages:
Last updated