Class protos.google.ai.generativelanguage.v1beta.DiscussService (2.6.0)

Represents a DiscussService

Inheritance

$protobuf.rpc.Service > protos.google.ai.generativelanguage.v1beta.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.v1beta.ICountMessageTokensRequest, callback: google.ai.generativelanguage.v1beta.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.v1beta.ICountMessageTokensRequest): Promise<google.ai.generativelanguage.v1beta.CountMessageTokensResponse>;

Calls CountMessageTokens.

Parameter
Name Description
request ICountMessageTokensRequest

CountMessageTokensRequest message or plain object

Returns
Type Description
Promise<google.ai.generativelanguage.v1beta.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.v1beta.IGenerateMessageRequest, callback: google.ai.generativelanguage.v1beta.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.v1beta.IGenerateMessageRequest): Promise<google.ai.generativelanguage.v1beta.GenerateMessageResponse>;

Calls GenerateMessage.

Parameter
Name Description
request IGenerateMessageRequest

GenerateMessageRequest message or plain object

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

Promise