Foundation Models Text Generation API, REST: TextGenerationBatch.Completion
A method for generating text completions in synchronous mode.
Note: Not implemented yet
HTTP request
POST https://llm.api.cloud.yandex.net/foundationModels/v1/completionBatch
Body parameters
{
"modelUri": "string",
"completionOptions": {
"stream": "boolean",
"temperature": "number",
"maxTokens": "string",
"reasoningOptions": {
"mode": "string"
}
},
// Includes only one of the fields `sourceDatasetId`
"sourceDatasetId": "string"
// end of the list of possible fields
}
Request for the service to generate batch text completion.
Field |
Description |
modelUri |
string The ID of the model to be used for batch completion generation. |
completionOptions |
Configuration options for completion generation. |
sourceDatasetId |
string ID of the dataset containing the context for the completion model. Includes only one of the fields Specifies the format of the request. |
CompletionOptions
Defines the options for completion generation.
Field |
Description |
stream |
boolean Enables streaming of partially generated text. |
temperature |
number (double) Affects creativity and randomness of responses. Should be a double number between 0 (inclusive) and 1 (inclusive). |
maxTokens |
string (int64) The limit on the number of tokens used for single completion generation. |
reasoningOptions |
Configures reasoning capabilities for the model, allowing it to perform internal reasoning before responding. |
ReasoningOptions
Represents reasoning options that enable the model's ability to perform internal reasoning before generating a response.
Field |
Description |
mode |
enum (ReasoningMode) Specifies the reasoning mode to be used.
|
Response
HTTP Code: 200 - OK
{
"id": "string",
"description": "string",
"createdAt": "string",
"createdBy": "string",
"modifiedAt": "string",
"done": "boolean",
"metadata": {
"taskId": "string",
"taskStatus": "string",
"completedBatches": "string",
"totalBatches": "string"
},
// Includes only one of the fields `error`, `response`
"error": {
"code": "integer",
"message": "string",
"details": [
"object"
]
},
"response": {
"taskId": "string",
"taskStatus": "string",
"resultDatasetId": "string"
}
// end of the list of possible fields
}
An Operation resource. For more information, see Operation.
Field |
Description |
id |
string ID of the operation. |
description |
string Description of the operation. 0-256 characters long. |
createdAt |
string (date-time) Creation timestamp. String in RFC3339 To work with values in this field, use the APIs described in the |
createdBy |
string ID of the user or service account who initiated the operation. |
modifiedAt |
string (date-time) The time when the Operation resource was last modified. String in RFC3339 To work with values in this field, use the APIs described in the |
done |
boolean If the value is |
metadata |
Service-specific metadata associated with the operation. |
error |
The error result of the operation in case of failure or cancellation. Includes only one of the fields The operation result. |
response |
The normal response of the operation in case of success. Includes only one of the fields The operation result. |
BatchCompletionMetadata
Metadata of the batch completion operation.
Field |
Description |
taskId |
string The ID of the batch completion task. |
taskStatus |
enum (BatchInferenceTaskStatus) The status of the batch completion task.
|
completedBatches |
string (int64) A number of currently completed batches of the completion task. |
totalBatches |
string (int64) A number of total batches of the completion task. |
Status
The error result of the operation in case of failure or cancellation.
Field |
Description |
code |
integer (int32) Error code. An enum value of google.rpc.Code |
message |
string An error message. |
details[] |
object A list of messages that carry the error details. |
BatchCompletionResponse
Response containing information about completion task.
Field |
Description |
taskId |
string The ID of the batch completion task. |
taskStatus |
enum (BatchInferenceTaskStatus) The status of the batch completion task.
|
resultDatasetId |
string The ID of the dataset containing completion results. |