pub struct AgentInput {
pub text: String,
pub context: Value,
}Expand description
Agent 输入。
用于向 Agent 传递用户请求。
§使用示例
use rucora_core::agent::AgentInput;
// 简单文本输入
let input = AgentInput::new("你好");
// 使用 builder 模式
let input = AgentInput::builder("帮我查询天气")
.with_context("user_location", "北京")
.build();Fields§
§text: String文本输入。
context: Value额外上下文数据。
Implementations§
Source§impl AgentInput
impl AgentInput
Sourcepub fn with_context(text: impl Into<String>, context: Value) -> Self
pub fn with_context(text: impl Into<String>, context: Value) -> Self
从文本和上下文创建输入。
Sourcepub fn builder(text: impl Into<String>) -> AgentInputBuilder
pub fn builder(text: impl Into<String>) -> AgentInputBuilder
创建 builder。
Trait Implementations§
Source§impl Clone for AgentInput
impl Clone for AgentInput
Source§fn clone(&self) -> AgentInput
fn clone(&self) -> AgentInput
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 AgentInput
impl Debug for AgentInput
Source§impl From<&str> for AgentInput
impl From<&str> for AgentInput
Auto Trait Implementations§
impl Freeze for AgentInput
impl RefUnwindSafe for AgentInput
impl Send for AgentInput
impl Sync for AgentInput
impl Unpin for AgentInput
impl UnsafeUnpin for AgentInput
impl UnwindSafe for AgentInput
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