Skip to main content

llm/usage/
call_purpose.rs

1use schemars::JsonSchema;
2use serde::{Deserialize, Serialize};
3
4/// What an LLM call was issued for.
5#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Serialize, Deserialize, JsonSchema)]
6#[serde(rename_all = "snake_case")]
7pub enum LlmCallPurpose {
8    Chat,
9    Compaction,
10}
11
12impl LlmCallPurpose {
13    pub fn as_str(self) -> &'static str {
14        match self {
15            Self::Chat => "chat",
16            Self::Compaction => "compaction",
17        }
18    }
19}