pub enum AgentModelRef {
Inherit,
ById {
model_id: ModelId,
provider_id: ProviderId,
},
ByAlias {
alias: String,
},
}Expand description
模型引用 — 轻量级标识,运行时解析为完整 ModelRef。
Agent 定义中不直接持有 API key、base_url 等敏感信息, 而是通过引用方式在运行时由 ModelResolver 解析。
§Examples
use katu_core::{AgentModelRef, ModelId, ProviderId};
// 继承调用者的模型
let inherit = AgentModelRef::Inherit;
// 按 ID 指定
let specific = AgentModelRef::by_id(
ModelId::new("gpt-4o"),
ProviderId::new("openai"),
);
// 按别名(如 "fast", "strong", "cheap")
let alias = AgentModelRef::by_alias("fast");Variants§
Implementations§
Trait Implementations§
Source§impl Clone for AgentModelRef
impl Clone for AgentModelRef
Source§fn clone(&self) -> AgentModelRef
fn clone(&self) -> AgentModelRef
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for AgentModelRef
impl Debug for AgentModelRef
Source§impl<'de> Deserialize<'de> for AgentModelRef
impl<'de> Deserialize<'de> for AgentModelRef
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for AgentModelRef
impl PartialEq for AgentModelRef
Source§fn eq(&self, other: &AgentModelRef) -> bool
fn eq(&self, other: &AgentModelRef) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl Serialize for AgentModelRef
impl Serialize for AgentModelRef
impl Eq for AgentModelRef
impl StructuralPartialEq for AgentModelRef
Auto Trait Implementations§
impl Freeze for AgentModelRef
impl RefUnwindSafe for AgentModelRef
impl Send for AgentModelRef
impl Sync for AgentModelRef
impl Unpin for AgentModelRef
impl UnsafeUnpin for AgentModelRef
impl UnwindSafe for AgentModelRef
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more