pub struct ToolInteractionRequest {
pub id: ToolInteractionId,
pub tool_name: ToolName,
pub call_id: Option<String>,
pub prompt: String,
pub kind: ToolInteractionKind,
}Expand description
Source-neutral interaction request produced by a tool handler.
§Examples
use tools_kit::{
declaration::ToolName,
interaction::{
ToolInteractionId, ToolInteractionKind, ToolInteractionRequest, ToolInteractionResponse,
},
};
let request = ToolInteractionRequest {
id: ToolInteractionId::new(), tool_name: ToolName::new("ask")?,
call_id: Some("call-1".into()), prompt: "Which city?".into(),
kind: ToolInteractionKind::Text { multiline: false },
};
let response = ToolInteractionResponse::submit(request.id.clone(), serde_json::json!("Chicago"));
assert_eq!(response.interaction_id(), &request.id);
Fields§
§id: ToolInteractionIdOpaque id used to correlate the caller response.
tool_name: ToolNameTool that requested the interaction.
call_id: Option<String>Optional caller-owned invocation correlation id.
prompt: StringHuman-readable prompt shown to the caller.
kind: ToolInteractionKindInput shape requested from the caller.
Trait Implementations§
Source§impl Clone for ToolInteractionRequest
impl Clone for ToolInteractionRequest
Source§impl Debug for ToolInteractionRequest
impl Debug for ToolInteractionRequest
Source§impl<'de> Deserialize<'de> for ToolInteractionRequest
impl<'de> Deserialize<'de> for ToolInteractionRequest
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 ToolInteractionRequest
impl PartialEq for ToolInteractionRequest
Source§impl Serialize for ToolInteractionRequest
impl Serialize for ToolInteractionRequest
impl StructuralPartialEq for ToolInteractionRequest
Auto Trait Implementations§
impl Freeze for ToolInteractionRequest
impl RefUnwindSafe for ToolInteractionRequest
impl Send for ToolInteractionRequest
impl Sync for ToolInteractionRequest
impl Unpin for ToolInteractionRequest
impl UnsafeUnpin for ToolInteractionRequest
impl UnwindSafe for ToolInteractionRequest
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