22 lines
663 B
Rust
22 lines
663 B
Rust
use std::borrow::Cow;
|
|
|
|
use akode_protocol::models::SearchToolCallParams;
|
|
|
|
/// Canonical payload shapes accepted by model-visible tool runtimes.
|
|
#[derive(Clone, Debug, PartialEq)]
|
|
pub enum ToolPayload {
|
|
Function { arguments: String },
|
|
ToolSearch { arguments: SearchToolCallParams },
|
|
Custom { input: String },
|
|
}
|
|
|
|
impl ToolPayload {
|
|
pub fn log_payload(&self) -> Cow<'_, str> {
|
|
match self {
|
|
ToolPayload::Function { arguments } => Cow::Borrowed(arguments),
|
|
ToolPayload::ToolSearch { arguments } => Cow::Owned(arguments.query.clone()),
|
|
ToolPayload::Custom { input } => Cow::Borrowed(input),
|
|
}
|
|
}
|
|
}
|