Skip to main content

agent_io/llm/types/
cache.rs

1//! Cache control types for prompt caching
2
3use serde::{Deserialize, Serialize};
4
5/// Cache control for prompt caching
6#[derive(Debug, Clone, Serialize, Deserialize)]
7pub struct CacheControl {
8    #[serde(rename = "type")]
9    pub control_type: CacheControlType,
10}
11
12#[derive(Debug, Clone, Serialize, Deserialize)]
13#[serde(rename_all = "snake_case")]
14pub enum CacheControlType {
15    Ephemeral,
16}
17
18impl CacheControl {
19    pub fn ephemeral() -> Self {
20        Self {
21            control_type: CacheControlType::Ephemeral,
22        }
23    }
24}