🐛 fix(test_agents_template.py): update assertions for template variables in test_zero_shot_agent

The assertions for the template variables in the `test_zero_shot_agent` function have been updated to reflect the changes in the template structure. This ensures that the tests accurately check the expected values of the template variables.
This commit is contained in:
Gabriel Luiz Freitas Almeida 2023-07-07 18:45:01 -03:00
commit 68bca25266

View file

@ -16,30 +16,94 @@ def test_zero_shot_agent(client: TestClient):
}
template = zero_shot_agent["template"]
assert template["llm_chain"] == {
assert template["tools"] == {
"required": True,
"placeholder": "",
"show": True,
"multiline": False,
"password": False,
"name": "llm_chain",
"type": "LLMChain",
"name": "tools",
"type": "BaseTool",
"list": True,
"advanced": False,
"info": "",
}
# Additional assertions for other template variables
assert template["callback_manager"] == {
"required": False,
"placeholder": "",
"show": False,
"multiline": False,
"password": False,
"name": "callback_manager",
"type": "BaseCallbackManager",
"list": False,
"advanced": False,
"info": "",
}
assert template["allowed_tools"] == {
"required": False,
assert template["llm"] == {
"required": True,
"placeholder": "",
"show": True,
"multiline": False,
"password": False,
"name": "allowed_tools",
"type": "Tool",
"name": "llm",
"type": "BaseLanguageModel",
"list": False,
"advanced": False,
"info": "",
}
assert template["output_parser"] == {
"required": False,
"placeholder": "",
"show": False,
"multiline": False,
"password": False,
"name": "output_parser",
"type": "AgentOutputParser",
"list": False,
"advanced": False,
"info": "",
}
assert template["input_variables"] == {
"required": False,
"placeholder": "",
"show": False,
"multiline": False,
"password": False,
"name": "input_variables",
"type": "str",
"list": True,
"advanced": False,
"info": "",
}
assert template["prefix"] == {
"required": False,
"placeholder": "",
"show": True,
"multiline": True,
"value": "Answer the following questions as best you can. You have access to the following tools:",
"password": False,
"name": "prefix",
"type": "str",
"list": False,
"advanced": False,
"info": "",
}
assert template["suffix"] == {
"required": False,
"placeholder": "",
"show": True,
"multiline": True,
"value": "Begin!\n\nQuestion: {input}\nThought:{agent_scratchpad}",
"password": False,
"name": "suffix",
"type": "str",
"list": False,
"advanced": False,
"info": "",
}
def test_json_agent(client: TestClient):