pub struct LLMAgentConfig {
pub agent_id: String,
pub name: String,
pub system_prompt: Option<String>,
pub temperature: Option<f32>,
pub max_tokens: Option<u32>,
pub custom_config: HashMap<String, String>,
pub user_id: Option<String>,
pub tenant_id: Option<String>,
pub context_window_size: Option<usize>,
}Expand description
LLM Agent 配置
Fields§
§agent_id: StringAgent ID
name: StringAgent 名称
system_prompt: Option<String>系统提示词
temperature: Option<f32>默认温度
max_tokens: Option<u32>默认最大 token 数
custom_config: HashMap<String, String>自定义配置
user_id: Option<String>用户 ID,用于数据库持久化和多用户场景
tenant_id: Option<String>租户 ID,用于多租户支持
context_window_size: Option<usize>上下文窗口大小,用于滑动窗口消息管理(单位:轮数/rounds)
注意:单位是轮数(rounds),不是 token 数量 每轮对话 ≈ 1 个用户消息 + 1 个助手响应
Trait Implementations§
Source§impl Clone for LLMAgentConfig
impl Clone for LLMAgentConfig
Source§fn clone(&self) -> LLMAgentConfig
fn clone(&self) -> LLMAgentConfig
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Default for LLMAgentConfig
impl Default for LLMAgentConfig
Source§fn default() -> LLMAgentConfig
fn default() -> LLMAgentConfig
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for LLMAgentConfig
impl RefUnwindSafe for LLMAgentConfig
impl Send for LLMAgentConfig
impl Sync for LLMAgentConfig
impl Unpin for LLMAgentConfig
impl UnsafeUnpin for LLMAgentConfig
impl UnwindSafe for LLMAgentConfig
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> Message for T
impl<T> Message for T
Source§fn from_boxed(m: BoxedMessage) -> Result<Self, BoxedDowncastErr>
fn from_boxed(m: BoxedMessage) -> Result<Self, BoxedDowncastErr>
Convert a BoxedMessage to this concrete type
Source§fn box_message(self, pid: &ActorId) -> Result<BoxedMessage, BoxedDowncastErr>
fn box_message(self, pid: &ActorId) -> Result<BoxedMessage, BoxedDowncastErr>
Convert this message to a BoxedMessage