refactor(loading.py): swap parameters order in instantiate_prompt function to match other functions
This commit is contained in:
parent
bb4ab77926
commit
eb86c8be64
1 changed files with 3 additions and 3 deletions
|
|
@ -54,7 +54,7 @@ def instantiate_based_on_type(class_object, base_type, node_type, params):
|
||||||
if base_type == "agents":
|
if base_type == "agents":
|
||||||
return instantiate_agent(class_object, params)
|
return instantiate_agent(class_object, params)
|
||||||
elif base_type == "prompts":
|
elif base_type == "prompts":
|
||||||
return instantiate_prompt(class_object, node_type, params)
|
return instantiate_prompt(node_type, class_object, params)
|
||||||
elif base_type == "tools":
|
elif base_type == "tools":
|
||||||
return instantiate_tool(node_type, class_object, params)
|
return instantiate_tool(node_type, class_object, params)
|
||||||
elif base_type == "toolkits":
|
elif base_type == "toolkits":
|
||||||
|
|
@ -77,7 +77,7 @@ def instantiate_agent(class_object, params):
|
||||||
return load_agent_executor(class_object, params)
|
return load_agent_executor(class_object, params)
|
||||||
|
|
||||||
|
|
||||||
def instantiate_prompt(class_object, node_type, params):
|
def instantiate_prompt(node_type, class_object, params):
|
||||||
if node_type == "ZeroShotPrompt":
|
if node_type == "ZeroShotPrompt":
|
||||||
if "tools" not in params:
|
if "tools" not in params:
|
||||||
params["tools"] = []
|
params["tools"] = []
|
||||||
|
|
@ -96,7 +96,7 @@ def instantiate_tool(node_type, class_object, params):
|
||||||
raise ValueError("Function should be a string")
|
raise ValueError("Function should be a string")
|
||||||
elif node_type.lower() == "tool":
|
elif node_type.lower() == "tool":
|
||||||
return class_object(**params)
|
return class_object(**params)
|
||||||
return None # Or some other default action
|
return class_object(**params)
|
||||||
|
|
||||||
|
|
||||||
def instantiate_toolkit(node_type, class_object, params):
|
def instantiate_toolkit(node_type, class_object, params):
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue