Class protos.google.ai.generativelanguage.v1beta3.TextService (2.4.0)

Represents a TextService

Inheritance

$protobuf.rpc.Service > protos.google.ai.generativelanguage.v1beta3.TextService

Package

@google-ai/generativelanguage

Constructors

(constructor)(rpcImpl, requestDelimited, responseDelimited)

constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean);

Constructs a new TextService service.

Parameters
Name Description
rpcImpl $protobuf.RPCImpl

RPC implementation

requestDelimited boolean

Whether requests are length-delimited

responseDelimited boolean

Whether responses are length-delimited

Methods

batchEmbedText(request, callback)

public batchEmbedText(request: google.ai.generativelanguage.v1beta3.IBatchEmbedTextRequest, callback: google.ai.generativelanguage.v1beta3.TextService.BatchEmbedTextCallback): void;

Calls BatchEmbedText.

Parameters
Name Description
request IBatchEmbedTextRequest

BatchEmbedTextRequest message or plain object

callback BatchEmbedTextCallback

Node-style callback called with the error, if any, and BatchEmbedTextResponse

Returns
Type Description
void

batchEmbedText(request)

public batchEmbedText(request: google.ai.generativelanguage.v1beta3.IBatchEmbedTextRequest): Promise<google.ai.generativelanguage.v1beta3.BatchEmbedTextResponse>;

Calls BatchEmbedText.

Parameter
Name Description
request IBatchEmbedTextRequest

BatchEmbedTextRequest message or plain object

Returns
Type Description
Promise<google.ai.generativelanguage.v1beta3.BatchEmbedTextResponse>

Promise

countTextTokens(request, callback)

public countTextTokens(request: google.ai.generativelanguage.v1beta3.ICountTextTokensRequest, callback: google.ai.generativelanguage.v1beta3.TextService.CountTextTokensCallback): void;

Calls CountTextTokens.

Parameters
Name Description
request ICountTextTokensRequest

CountTextTokensRequest message or plain object

callback CountTextTokensCallback

Node-style callback called with the error, if any, and CountTextTokensResponse

Returns
Type Description
void

countTextTokens(request)

public countTextTokens(request: google.ai.generativelanguage.v1beta3.ICountTextTokensRequest): Promise<google.ai.generativelanguage.v1beta3.CountTextTokensResponse>;

Calls CountTextTokens.

Parameter
Name Description
request ICountTextTokensRequest

CountTextTokensRequest message or plain object

Returns
Type Description
Promise<google.ai.generativelanguage.v1beta3.CountTextTokensResponse>

Promise

create(rpcImpl, requestDelimited, responseDelimited)

public static create(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean): TextService;

Creates new TextService service using the specified rpc implementation.

Parameters
Name Description
rpcImpl $protobuf.RPCImpl

RPC implementation

requestDelimited boolean

Whether requests are length-delimited

responseDelimited boolean

Whether responses are length-delimited

Returns
Type Description
TextService

RPC service. Useful where requests and/or responses are streamed.

embedText(request, callback)

public embedText(request: google.ai.generativelanguage.v1beta3.IEmbedTextRequest, callback: google.ai.generativelanguage.v1beta3.TextService.EmbedTextCallback): void;

Calls EmbedText.

Parameters
Name Description
request IEmbedTextRequest

EmbedTextRequest message or plain object

callback EmbedTextCallback

Node-style callback called with the error, if any, and EmbedTextResponse

Returns
Type Description
void

embedText(request)

public embedText(request: google.ai.generativelanguage.v1beta3.IEmbedTextRequest): Promise<google.ai.generativelanguage.v1beta3.EmbedTextResponse>;

Calls EmbedText.

Parameter
Name Description
request IEmbedTextRequest

EmbedTextRequest message or plain object

Returns
Type Description
Promise<google.ai.generativelanguage.v1beta3.EmbedTextResponse>

Promise

generateText(request, callback)

public generateText(request: google.ai.generativelanguage.v1beta3.IGenerateTextRequest, callback: google.ai.generativelanguage.v1beta3.TextService.GenerateTextCallback): void;

Calls GenerateText.

Parameters
Name Description
request IGenerateTextRequest

GenerateTextRequest message or plain object

callback GenerateTextCallback

Node-style callback called with the error, if any, and GenerateTextResponse

Returns
Type Description
void

generateText(request)

public generateText(request: google.ai.generativelanguage.v1beta3.IGenerateTextRequest): Promise<google.ai.generativelanguage.v1beta3.GenerateTextResponse>;

Calls GenerateText.

Parameter
Name Description
request IGenerateTextRequest

GenerateTextRequest message or plain object

Returns
Type Description
Promise<google.ai.generativelanguage.v1beta3.GenerateTextResponse>

Promise