create_context_cache(
model: ChatVertexAI,
messages: list[BaseMessage],
expire_time: datetime| Name | Type | Description |
|---|---|---|
model* | ChatVertexAI |
|
messages* | list[BaseMessage] | List of messages to cache. |
expire_time | datetime | None | Default: NoneTimestamp of when this resource is considered expired. At most one of |
time_to_live | timedelta | None | Default: None |
tools | _ToolsType | None | Default: None |
tool_config | _ToolConfigDict | None | Default: None |
Creates a cache for content in some model.
The TTL for this resource. If provided, the expiration time is
computed as created_time + TTL.
At most one of expire_time and time_to_live can be set. If neither is
set, default TTL on the API side will be used (currently 1 hour).
A list of tool definitions to bind to this chat model.
Can be a Pydantic model, Callable, or BaseTool. Pydantic models,
Callable, and BaseTool will be automatically converted to their schema
dictionary representation.
Optional. Immutable. Tool config. This config is shared for all tools.