mirror of
https://github.com/katanemo/plano.git
synced 2026-05-06 14:22:51 +02:00
Add supported parameter type, validation and tests (#88)
* Add supported parameter type and validation * make the tools format more compliant with openai * more updates * fix more * fix unit test
This commit is contained in:
parent
59229b8fc9
commit
75cf5e5304
7 changed files with 273 additions and 11 deletions
|
|
@ -17,7 +17,7 @@ use proxy_wasm::types::*;
|
|||
use public_types::common_types::open_ai::{
|
||||
ChatCompletionChunkResponse, ChatCompletionTool, ChatCompletionsRequest,
|
||||
ChatCompletionsResponse, FunctionDefinition, FunctionParameter, FunctionParameters, Message,
|
||||
StreamOptions, ToolType,
|
||||
ParameterType, StreamOptions, ToolType,
|
||||
};
|
||||
use public_types::common_types::{
|
||||
EmbeddingType, PromptGuardRequest, PromptGuardResponse, PromptGuardTask,
|
||||
|
|
@ -369,7 +369,9 @@ impl StreamContext {
|
|||
let mut properties: HashMap<String, FunctionParameter> = HashMap::new();
|
||||
for entity in entities.iter() {
|
||||
let param = FunctionParameter {
|
||||
parameter_type: entity.parameter_type.clone(),
|
||||
parameter_type: ParameterType::from(
|
||||
entity.parameter_type.clone().unwrap_or("str".to_string()),
|
||||
),
|
||||
description: entity.description.clone(),
|
||||
required: entity.required,
|
||||
enum_values: entity.enum_values.clone(),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue