/completions
Generate or stream a new completion.
Body
The Commonbase project ID.
An optional custom string used to identify users in the invocation logs.
The text used to generate a completion when providerConfig.params.type: 'text'
is set.
One of prompt
or messages
must be sent with each request.
A list of messages for chat completions. providerConfig.params.type
must be
set to 'chat'
, otherwise these messages are ignored.
One of prompt
or messages
must be sent with each request.
A list of functions that the LLM can call.
A parameter used to tell the LLM to call a specific function.
The completion provider configuration. A different configuration object is used for each provider.
Determines whether to stream a response as it is generated.
Determines whether to return token count and cost of the LLM response.
Success Response
Indicates whether the completion is finished. completed
may be false
while
streaming a partial response.
The ID of the invocation.
The ID of the project.
The type of the completion response.
The name of the LLM model used for the completion.
The usage information about the token costs of the invocation.
The cost of the invocation in dollars.
Error Response
An error message explaining why the response failed.
The ID of the invocation.