mirror of
https://github.com/katanemo/plano.git
synced 2026-04-25 00:36:34 +02:00
comment required param check
This commit is contained in:
parent
31f26ef7ac
commit
233976a568
1 changed files with 24 additions and 24 deletions
|
|
@ -472,30 +472,30 @@ impl StreamContext {
|
|||
.unwrap()
|
||||
.clone();
|
||||
|
||||
// verify required parameters are present
|
||||
prompt_target
|
||||
.parameters
|
||||
.as_ref()
|
||||
.unwrap()
|
||||
.iter()
|
||||
.for_each(|param| match param.required {
|
||||
None => {}
|
||||
Some(required) => {
|
||||
if required
|
||||
&& !tools_call_response.tool_calls[0]
|
||||
.arguments
|
||||
.contains_key(¶m.name)
|
||||
{
|
||||
self.send_server_error(
|
||||
format!(
|
||||
"missing required parameter: {}, for target: {}",
|
||||
param.name, prompt_target.name
|
||||
),
|
||||
Some(StatusCode::BAD_REQUEST),
|
||||
)
|
||||
}
|
||||
}
|
||||
});
|
||||
// // verify required parameters are present
|
||||
// prompt_target
|
||||
// .parameters
|
||||
// .as_ref()
|
||||
// .unwrap()
|
||||
// .iter()
|
||||
// .for_each(|param| match param.required {
|
||||
// None => {}
|
||||
// Some(required) => {
|
||||
// if required
|
||||
// && !tools_call_response.tool_calls[0]
|
||||
// .arguments
|
||||
// .contains_key(¶m.name)
|
||||
// {
|
||||
// self.send_server_error(
|
||||
// format!(
|
||||
// "missing required parameter: {}, for target: {}",
|
||||
// param.name, prompt_target.name
|
||||
// ),
|
||||
// Some(StatusCode::BAD_REQUEST),
|
||||
// )
|
||||
// }
|
||||
// }
|
||||
// });
|
||||
|
||||
debug!("tool_call_details: {:?}", tools_call_response);
|
||||
let tool_name = &tools_call_response.tool_calls[0].name;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue