Represents a TextService
Inheritance
$protobuf.rpc.Service > protos.google.ai.generativelanguage.v1beta2.TextServicePackage
@google-ai/generativelanguageConstructors
(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
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.v1beta2.IEmbedTextRequest, callback: google.ai.generativelanguage.v1beta2.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.v1beta2.IEmbedTextRequest): Promise<google.ai.generativelanguage.v1beta2.EmbedTextResponse>;
Calls EmbedText.
Parameter | |
---|---|
Name | Description |
request |
IEmbedTextRequest
EmbedTextRequest message or plain object |
Returns | |
---|---|
Type | Description |
Promise<google.ai.generativelanguage.v1beta2.EmbedTextResponse> |
Promise |
generateText(request, callback)
public generateText(request: google.ai.generativelanguage.v1beta2.IGenerateTextRequest, callback: google.ai.generativelanguage.v1beta2.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.v1beta2.IGenerateTextRequest): Promise<google.ai.generativelanguage.v1beta2.GenerateTextResponse>;
Calls GenerateText.
Parameter | |
---|---|
Name | Description |
request |
IGenerateTextRequest
GenerateTextRequest message or plain object |
Returns | |
---|---|
Type | Description |
Promise<google.ai.generativelanguage.v1beta2.GenerateTextResponse> |
Promise |