use serde::{Deserialize, Serialize};
use serde_json::Value;
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct Tool {
pub name: String,
pub description: String,
pub input_schema: Value,
}
impl Tool {
pub fn new<N, D>(name: N, description: D, input_schema: Value) -> Self
where
N: Into<String>,
D: Into<String>,
{
Tool {
name: name.into(),
description: description.into(),
input_schema,
}
}
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct ToolCall {
pub name: String,
pub arguments: Value,
}
impl ToolCall {
pub fn new<S: Into<String>>(name: S, arguments: Value) -> Self {
Self {
name: name.into(),
arguments,
}
}
}