Table of Contents

Class Caches

Namespace
Google.GenAI
Assembly
Google.GenAI.dll
public sealed class Caches
Inheritance
Caches
Inherited Members

Constructors

Caches(ApiClient)

public Caches(ApiClient apiClient)

Parameters

apiClient ApiClient

Methods

CreateAsync(string, CreateCachedContentConfig?, CancellationToken)

public Task<CachedContent> CreateAsync(string model, CreateCachedContentConfig? config = null, CancellationToken cancellationToken = default)

Parameters

model string
config CreateCachedContentConfig
cancellationToken CancellationToken

Returns

Task<CachedContent>

DeleteAsync(string, DeleteCachedContentConfig?, CancellationToken)

public Task<DeleteCachedContentResponse> DeleteAsync(string name, DeleteCachedContentConfig? config = null, CancellationToken cancellationToken = default)

Parameters

name string
config DeleteCachedContentConfig
cancellationToken CancellationToken

Returns

Task<DeleteCachedContentResponse>

GetAsync(string, GetCachedContentConfig?, CancellationToken)

public Task<CachedContent> GetAsync(string name, GetCachedContentConfig? config = null, CancellationToken cancellationToken = default)

Parameters

name string
config GetCachedContentConfig
cancellationToken CancellationToken

Returns

Task<CachedContent>

ListAsync(ListCachedContentsConfig?, CancellationToken)

Lists cached contents asynchronously.

public Task<Pager<CachedContent, ListCachedContentsConfig, ListCachedContentsResponse>> ListAsync(ListCachedContentsConfig? config = null, CancellationToken cancellationToken = default)

Parameters

config ListCachedContentsConfig

A ListCachedContentsConfig instance that specifies the optional configuration for the list request.

cancellationToken CancellationToken

The CancellationToken for the request.

Returns

Task<Pager<CachedContent, ListCachedContentsConfig, ListCachedContentsResponse>>

A Pager object that contains one page of cached contents. When iterating over the pager, it automatically fetches the next page if there are more.

UpdateAsync(string, UpdateCachedContentConfig?, CancellationToken)

public Task<CachedContent> UpdateAsync(string name, UpdateCachedContentConfig? config = null, CancellationToken cancellationToken = default)

Parameters

name string
config UpdateCachedContentConfig
cancellationToken CancellationToken

Returns

Task<CachedContent>