refac: remove iosession as required

This commit is contained in:
Ibis Prevedello 2023-03-09 21:23:42 -03:00
commit 66e4b33b7c

View file

@ -86,7 +86,7 @@ def get_tool_signature(name: str):
type_dict = { type_dict = {
"str": { "str": {
"type": "str", "type": "str",
"required": False, "required": True,
"list": False, "list": False,
"show": True, "show": True,
"placeholder": "", "placeholder": "",
@ -111,9 +111,15 @@ def get_tool_signature(name: str):
params = [] params = []
template = { template = {
param: (type_dict[param] if param == "llm" else type_dict["str"]) param: (type_dict[param].copy() if param == "llm" else type_dict["str"].copy())
for param in params for param in params
} # type: Dict[str, Any] }
# Remove required from aiosession
if "aiosession" in template.keys():
template["aiosession"]["required"] = False
template["aiosession"]["show"] = False
template["_type"] = tool_type template["_type"] = tool_type
return { return {