mirror of
https://github.com/katanemo/plano.git
synced 2026-06-17 15:25:17 +02:00
fix rest file
This commit is contained in:
parent
44872107a8
commit
14625e2a1d
3 changed files with 47 additions and 10 deletions
|
|
@ -236,9 +236,9 @@ pub struct PromptTarget {
|
|||
}
|
||||
|
||||
// convert PromptTarget to ChatCompletionTool
|
||||
impl Into<ChatCompletionTool> for &PromptTarget {
|
||||
fn into(self) -> ChatCompletionTool {
|
||||
let properties: HashMap<String, FunctionParameter> = match self.parameters {
|
||||
impl From<&PromptTarget> for ChatCompletionTool {
|
||||
fn from(val: &PromptTarget) -> Self {
|
||||
let properties: HashMap<String, FunctionParameter> = match val.parameters {
|
||||
Some(ref entities) => {
|
||||
let mut properties: HashMap<String, FunctionParameter> = HashMap::new();
|
||||
for entity in entities.iter() {
|
||||
|
|
@ -261,8 +261,8 @@ impl Into<ChatCompletionTool> for &PromptTarget {
|
|||
ChatCompletionTool {
|
||||
tool_type: crate::api::open_ai::ToolType::Function,
|
||||
function: FunctionDefinition {
|
||||
name: self.name.clone(),
|
||||
description: self.description.clone(),
|
||||
name: val.name.clone(),
|
||||
description: val.description.clone(),
|
||||
parameters: FunctionParameters { properties },
|
||||
},
|
||||
}
|
||||
|
|
|
|||
|
|
@ -20,12 +20,10 @@ pub fn replace_params_in_path(
|
|||
return Err(format!("Missing value for parameter `{}`", param_name));
|
||||
}
|
||||
current_param.clear();
|
||||
} else if in_param {
|
||||
current_param.push(c);
|
||||
} else {
|
||||
if in_param {
|
||||
current_param.push(c);
|
||||
} else {
|
||||
result.push(c);
|
||||
}
|
||||
result.push(c);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue