CacheService class final
API for managing cache of content (CachedContent resources) that can be used in GenerativeService requests. This way generate content requests can benefit from preprocessing work being done earlier, possibly lowering their computational cost. It is intended to be used with large contexts.
Constructors
- CacheService({required Client client})
-
Creates a
CacheServiceusingclientfor transport. - CacheService.fromApiKey([String? apiKey])
-
Creates a
CacheServicethat does authentication through an API key.factory
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
cancelOperation(
CancelOperationRequest request) → Future< void> -
Provides the
Operationsservice functionality in this service. -
close(
) → void - Closes the client and cleans up any resources associated with it.
-
createCachedContent(
CreateCachedContentRequest request) → Future< CachedContent> - Creates CachedContent resource.
-
deleteCachedContent(
DeleteCachedContentRequest request) → Future< void> - Deletes CachedContent resource.
-
deleteOperation(
DeleteOperationRequest request) → Future< void> -
Provides the
Operationsservice functionality in this service. -
getCachedContent(
GetCachedContentRequest request) → Future< CachedContent> - Reads CachedContent resource.
-
getOperation<
T extends ProtoMessage, S extends ProtoMessage> (Operation< T, S> request) → Future<Operation< T, S> > -
Provides the
Operationsservice functionality in this service. -
listCachedContents(
ListCachedContentsRequest request) → Future< ListCachedContentsResponse> - Lists CachedContents.
-
listOperations(
ListOperationsRequest request) → Future< ListOperationsResponse> -
Provides the
Operationsservice functionality in this service. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
-
updateCachedContent(
UpdateCachedContentRequest request) → Future< CachedContent> - Updates CachedContent resource (only expiration is updatable).
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited