Skip to main content

cpex_core/extensions/
llm.rs

1// Location: ./crates/cpex-core/src/extensions/llm.rs
2// Copyright 2025
3// SPDX-License-Identifier: Apache-2.0
4// Authors: Teryl Taylor
5//
6// LLMExtension — model identity and capabilities.
7// Mirrors cpex/framework/extensions/llm.py.
8
9use serde::{Deserialize, Serialize};
10
11/// Model identity and capabilities.
12///
13/// Immutable — set by the host.
14#[derive(Debug, Clone, Default, Serialize, Deserialize)]
15pub struct LLMExtension {
16    /// Model identifier (e.g., "gpt-4o", "claude-sonnet-4-20250514").
17    #[serde(default, skip_serializing_if = "Option::is_none")]
18    pub model_id: Option<String>,
19
20    /// Provider name (e.g., "openai", "anthropic").
21    #[serde(default, skip_serializing_if = "Option::is_none")]
22    pub provider: Option<String>,
23
24    /// Model capabilities (e.g., "tool_use", "vision", "streaming").
25    #[serde(default)]
26    pub capabilities: Vec<String>,
27}