Class protos.google.ai.generativelanguage.v1beta2.ModelService (2.4.0)

Represents a ModelService

Inheritance

$protobuf.rpc.Service > protos.google.ai.generativelanguage.v1beta2.ModelService

Package

@google-ai/generativelanguage

Constructors

(constructor)(rpcImpl, requestDelimited, responseDelimited)

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

Constructs a new ModelService service.

Parameters
Name Description
rpcImpl $protobuf.RPCImpl

RPC implementation

requestDelimited boolean

Whether requests are length-delimited

responseDelimited boolean

Whether responses are length-delimited

Methods

create(rpcImpl, requestDelimited, responseDelimited)

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

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

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

getModel(request, callback)

public getModel(request: google.ai.generativelanguage.v1beta2.IGetModelRequest, callback: google.ai.generativelanguage.v1beta2.ModelService.GetModelCallback): void;

Calls GetModel.

Parameters
Name Description
request IGetModelRequest

GetModelRequest message or plain object

callback GetModelCallback

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

Returns
Type Description
void

getModel(request)

public getModel(request: google.ai.generativelanguage.v1beta2.IGetModelRequest): Promise<google.ai.generativelanguage.v1beta2.Model>;

Calls GetModel.

Parameter
Name Description
request IGetModelRequest

GetModelRequest message or plain object

Returns
Type Description
Promise<google.ai.generativelanguage.v1beta2.Model>

Promise

listModels(request, callback)

public listModels(request: google.ai.generativelanguage.v1beta2.IListModelsRequest, callback: google.ai.generativelanguage.v1beta2.ModelService.ListModelsCallback): void;

Calls ListModels.

Parameters
Name Description
request IListModelsRequest

ListModelsRequest message or plain object

callback ListModelsCallback

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

Returns
Type Description
void

listModels(request)

public listModels(request: google.ai.generativelanguage.v1beta2.IListModelsRequest): Promise<google.ai.generativelanguage.v1beta2.ListModelsResponse>;

Calls ListModels.

Parameter
Name Description
request IListModelsRequest

ListModelsRequest message or plain object

Returns
Type Description
Promise<google.ai.generativelanguage.v1beta2.ListModelsResponse>

Promise