pub struct HumanLoopRequest {
pub kind: HumanLoopKind,
pub prompt: String,
pub tool_name: Option<String>,
pub args: Option<Value>,
pub risk_level: Option<RiskLevel>,
pub timeout: Option<Duration>,
}Available on crate feature
human-loop only.Expand description
向人工发起的介入请求
Fields§
§kind: HumanLoopKind请求类型
prompt: String给用户的提示信息
tool_name: Option<String>工具名称(仅 Approval 场景)
args: Option<Value>工具参数(仅 Approval 场景)
risk_level: Option<RiskLevel>风险等级(仅 Approval 场景)
timeout: Option<Duration>超时时长(None 表示无限等待)
Implementations§
Source§impl HumanLoopRequest
impl HumanLoopRequest
Sourcepub fn approval_with_risk(
tool_name: impl Into<String>,
args: Value,
risk_level: RiskLevel,
) -> HumanLoopRequest
pub fn approval_with_risk( tool_name: impl Into<String>, args: Value, risk_level: RiskLevel, ) -> HumanLoopRequest
构造带风险等级的审批请求
Sourcepub fn approval_with_timeout(
tool_name: impl Into<String>,
args: Value,
timeout: Duration,
) -> HumanLoopRequest
pub fn approval_with_timeout( tool_name: impl Into<String>, args: Value, timeout: Duration, ) -> HumanLoopRequest
构造带超时的审批请求
Sourcepub fn input(prompt: impl Into<String>) -> HumanLoopRequest
pub fn input(prompt: impl Into<String>) -> HumanLoopRequest
构造文本输入请求
Trait Implementations§
Source§impl Clone for HumanLoopRequest
impl Clone for HumanLoopRequest
Source§fn clone(&self) -> HumanLoopRequest
fn clone(&self) -> HumanLoopRequest
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 moreAuto Trait Implementations§
impl Freeze for HumanLoopRequest
impl RefUnwindSafe for HumanLoopRequest
impl Send for HumanLoopRequest
impl Sync for HumanLoopRequest
impl Unpin for HumanLoopRequest
impl UnsafeUnpin for HumanLoopRequest
impl UnwindSafe for HumanLoopRequest
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> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
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> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request