pub struct ReActStep {
pub step_type: ReActStepType,
pub content: String,
pub tool_name: Option<String>,
pub tool_input: Option<String>,
pub step_number: usize,
pub timestamp: u64,
}Expand description
ReAct 执行步骤
Fields§
§step_type: ReActStepType步骤类型
content: String步骤内容
tool_name: Option<String>使用的工具名称 (仅 Action 步骤)
tool_input: Option<String>工具输入 (仅 Action 步骤)
step_number: usize步骤序号
timestamp: u64时间戳 (毫秒)
Implementations§
Source§impl ReActStep
impl ReActStep
pub fn thought(content: impl Into<String>, step_number: usize) -> Self
pub fn action( tool_name: impl Into<String>, tool_input: impl Into<String>, step_number: usize, ) -> Self
pub fn observation(content: impl Into<String>, step_number: usize) -> Self
pub fn final_answer(content: impl Into<String>, step_number: usize) -> Self
Trait Implementations§
Source§impl<'de> Deserialize<'de> for ReActStep
impl<'de> Deserialize<'de> for ReActStep
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
Auto Trait Implementations§
impl Freeze for ReActStep
impl RefUnwindSafe for ReActStep
impl Send for ReActStep
impl Sync for ReActStep
impl Unpin for ReActStep
impl UnsafeUnpin for ReActStep
impl UnwindSafe for ReActStep
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