use crate::function_executor::function_argument::FunctionArgument;
#[derive(Debug)]
pub struct FunctionSchema {
function_name: String,
arguments: Vec<FunctionArgument>,
}
impl FunctionSchema {
pub fn new(
function_name: impl Into<String>,
) -> FunctionSchema {
let function_name = function_name.into();
if function_name.is_empty() {
panic!("Passed function name is empty");
}
return FunctionSchema {
function_name,
arguments: Vec::new(),
}
}
pub fn with_argument(mut self, argument: FunctionArgument) -> Self {
self.arguments.push(argument);
return self;
}
pub fn get_function_name(&self) -> &String {
return &self.function_name;
}
pub fn get_arguments(&self) -> &[FunctionArgument] {
return &self.arguments;
}
}