Foundation Models Text Generation API, gRPC: TextGenerationAsyncService
Written by
Updated at April 11, 2024
Service for asynchronous text generation.
Call | Description |
---|---|
Completion | A method for generating text completions in asynchronous mode. |
Calls TextGenerationAsyncService
Completion
A method for generating text completions in asynchronous mode.
rpc Completion (CompletionRequest) returns (operation.Operation)
Response of Operation:
Operation.response:CompletionResponse
CompletionRequest
Field | Description |
---|---|
model_uri | string The ID of the model to be used for completion generation. |
completion_options | CompletionOptions Configuration options for completion generation. |
messages[] | Message A list of messages representing the context for the completion model. |
Operation
Field | Description |
---|---|
id | string ID of the operation. |
description | string Description of the operation. 0-256 characters long. |
created_at | google.protobuf.Timestamp Creation timestamp. |
created_by | string ID of the user or service account who initiated the operation. |
modified_at | google.protobuf.Timestamp The time when the Operation resource was last modified. |
done | bool If the value is false , it means the operation is still in progress. If true , the operation is completed, and either error or response is available. |
metadata | google.protobuf.Any Service-specific metadata associated with the operation. It typically contains the ID of the target resource that the operation is performed on. Any method that returns a long-running operation should document the metadata type, if any. |
result | oneof: error or response The operation result. If done == false and there was no failure detected, neither error nor response is set. If done == false and there was a failure detected, error is set. If done == true , exactly one of error or response is set. |
error | google.rpc.Status The error result of the operation in case of failure or cancellation. |
response | google.protobuf.Any if operation finished successfully. |
CompletionResponse
Field | Description |
---|---|
alternatives[] | Alternative A list of generated completion alternatives. |
usage | ContentUsage A set of statistics describing the number of content tokens used by the completion model. |
model_version | string The model version changes with each new releases. |