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<T, S>> getOperation<T extends ProtoMessage, S extends ProtoMessage>(Operation<T, S> request)?, Future<void> deleteOperation(DeleteOperationRequest request)?, Future<void> cancelOperation(CancelOperationRequest request)?})

Properties

hashCode int
The hash code for this object.
no setterinherited
isClosed bool
getter/setter pair
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

batchEmbedContents(BatchEmbedContentsRequest request) Future<BatchEmbedContentsResponse>
Generates multiple embedding vectors from the input Content which consists of a batch of strings represented as EmbedContentRequest objects.
override
cancelOperation(CancelOperationRequest request) Future<void>
Provides the Operations service 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 Content and returns the token count. Refer to the tokens guide to learn more about tokens.
override
deleteOperation(DeleteOperationRequest request) Future<void>
Provides the Operations service functionality in this service.
override
embedContent(EmbedContentRequest request) Future<EmbedContentResponse>
Generates a text embedding vector from the input Content using 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 Operations service functionality in this service.
override
listOperations(ListOperationsRequest request) Future<ListOperationsResponse>
Provides the Operations service 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