Class protos.google.ai.generativelanguage.v1beta3.DiscussService (2.8.0)

Represents a DiscussService

Inheritance

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

Package

@google-ai/generativelanguage

Constructors

(constructor)(rpcImpl, requestDelimited, responseDelimited)

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

Constructs a new DiscussService service.

Parameters
Name Description
rpcImpl $protobuf.RPCImpl

RPC implementation

requestDelimited boolean

Whether requests are length-delimited

responseDelimited boolean

Whether responses are length-delimited

Methods

countMessageTokens(request, callback)

public countMessageTokens(request: google.ai.generativelanguage.v1beta3.ICountMessageTokensRequest, callback: google.ai.generativelanguage.v1beta3.DiscussService.CountMessageTokensCallback): void;

Calls CountMessageTokens.

Parameters
Name Description
request ICountMessageTokensRequest

CountMessageTokensRequest message or plain object

callback CountMessageTokensCallback

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

Returns
Type Description
void

countMessageTokens(request)

public countMessageTokens(request: google.ai.generativelanguage.v1beta3.ICountMessageTokensRequest): Promise<google.ai.generativelanguage.v1beta3.CountMessageTokensResponse>;

Calls CountMessageTokens.

Parameter
Name Description
request ICountMessageTokensRequest

CountMessageTokensRequest message or plain object

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

Promise

create(rpcImpl, requestDelimited, responseDelimited)

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

Creates new DiscussService 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
DiscussService

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

generateMessage(request, callback)

public generateMessage(request: google.ai.generativelanguage.v1beta3.IGenerateMessageRequest, callback: google.ai.generativelanguage.v1beta3.DiscussService.GenerateMessageCallback): void;

Calls GenerateMessage.

Parameters
Name Description
request IGenerateMessageRequest

GenerateMessageRequest message or plain object

callback GenerateMessageCallback

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

Returns
Type Description
void

generateMessage(request)

public generateMessage(request: google.ai.generativelanguage.v1beta3.IGenerateMessageRequest): Promise<google.ai.generativelanguage.v1beta3.GenerateMessageResponse>;

Calls GenerateMessage.

Parameter
Name Description
request IGenerateMessageRequest

GenerateMessageRequest message or plain object

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

Promise