TextService class final

API for using Generative Language Models (GLMs) trained to generate text.

Also known as Large Language Models (LLM)s, these generate text given an input prompt from the user.

Constructors

TextService({required Client client})
Creates a TextService using client for transport.
TextService.fromApiKey([String? apiKey])
Creates a TextService that does authentication through an API key.
factory

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

batchEmbedText(BatchEmbedTextRequest request) Future<BatchEmbedTextResponse>
Generates multiple embeddings from the model given input text in a synchronous call.
cancelOperation(CancelOperationRequest request) Future<void>
Provides the Operations service functionality in this service.
close() → void
Closes the client and cleans up any resources associated with it.
countTextTokens(CountTextTokensRequest request) Future<CountTextTokensResponse>
Runs a model's tokenizer on a text and returns the token count.
deleteOperation(DeleteOperationRequest request) Future<void>
Provides the Operations service functionality in this service.
embedText(EmbedTextRequest request) Future<EmbedTextResponse>
Generates an embedding from the model given an input message.
generateText(GenerateTextRequest request) Future<GenerateTextResponse>
Generates a response from the model given an input message.
getOperation<T extends ProtoMessage, S extends ProtoMessage>(Operation<T, S> request) Future<Operation<T, S>>
Provides the Operations service functionality in this service.
listOperations(ListOperationsRequest request) Future<ListOperationsResponse>
Provides the Operations service functionality in this service.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited