FakeGenerativeService class base
Testing fake for GenerativeService.
- Implemented types
Constructors
-
FakeGenerativeService({Future<
GenerateContentResponse> generateContent(GenerateContentRequest request)?, Future<GenerateAnswerResponse> generateAnswer(GenerateAnswerRequest request)?, Stream<GenerateContentResponse> streamGenerateContent(GenerateContentRequest request)?, Future<EmbedContentResponse> embedContent(EmbedContentRequest request)?, Future<BatchEmbedContentsResponse> batchEmbedContents(BatchEmbedContentsRequest request)?, Future<CountTokensResponse> countTokens(CountTokensRequest request)?, Future<ListOperationsResponse> listOperations(ListOperationsRequest request)?, Future<Operation< getOperation<T, S> >T extends ProtoMessage, S extends ProtoMessage>(Operation< Future<T, S> request)?,void> deleteOperation(DeleteOperationRequest request)?, Future<void> cancelOperation(CancelOperationRequest request)?})
Properties
Methods
-
batchEmbedContents(
BatchEmbedContentsRequest request) → Future< BatchEmbedContentsResponse> -
Generates multiple embedding vectors from the input
Contentwhich consists of a batch of strings represented asEmbedContentRequestobjects.override -
cancelOperation(
CancelOperationRequest request) → Future< void> -
Provides the
Operationsservice functionality in this service.override -
close(
) → void -
Closes the client and cleans up any resources associated with it.
override
-
countTokens(
CountTokensRequest request) → Future< CountTokensResponse> -
Runs a model's tokenizer on input
Contentand returns the token count. Refer to the tokens guide to learn more about tokens.override -
deleteOperation(
DeleteOperationRequest request) → Future< void> -
Provides the
Operationsservice functionality in this service.override -
embedContent(
EmbedContentRequest request) → Future< EmbedContentResponse> -
Generates a text embedding vector from the input
Contentusing the specified Gemini Embedding model.override -
generateAnswer(
GenerateAnswerRequest request) → Future< GenerateAnswerResponse> -
Generates a grounded answer from the model given an input
GenerateAnswerRequest.override -
generateContent(
GenerateContentRequest request) → Future< GenerateContentResponse> -
Generates a model response given an input
GenerateContentRequest. Refer to the text generation guide for detailed usage information. Input capabilities differ between models, including tuned models. Refer to the model guide and tuning guide for details.override -
getOperation<
T extends ProtoMessage, S extends ProtoMessage> (Operation< T, S> request) → Future<Operation< T, S> > -
Provides the
Operationsservice functionality in this service.override -
listOperations(
ListOperationsRequest request) → Future< ListOperationsResponse> -
Provides the
Operationsservice functionality in this service.override -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
streamGenerateContent(
GenerateContentRequest request) → Stream< GenerateContentResponse> -
Generates a streamed
response
from the model given an input
GenerateContentRequest.override -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited