Tests fix
This commit is contained in:
parent
1f135d09ec
commit
ceb6fda4c6
5 changed files with 61 additions and 81 deletions
|
|
@ -18,14 +18,15 @@ def test_conversation_chain(client: TestClient):
|
|||
chains = json_response["chains"]
|
||||
|
||||
chain = chains["ConversationChain"]
|
||||
|
||||
# Test the base classes, template, memory, verbose, llm, input_key, output_key, and _type objects
|
||||
assert set(chain["base_classes"]) == {
|
||||
"function",
|
||||
"LLMChain",
|
||||
"ConversationChain",
|
||||
"LLMChain",
|
||||
"Chain",
|
||||
"Serializable",
|
||||
"function",
|
||||
}
|
||||
|
||||
template = chain["template"]
|
||||
assert template["memory"] == {
|
||||
"required": False,
|
||||
|
|
@ -101,7 +102,13 @@ def test_llm_chain(client: TestClient):
|
|||
chain = chains["LLMChain"]
|
||||
|
||||
# Test the base classes, template, memory, verbose, llm, input_key, output_key, and _type objects
|
||||
assert set(chain["base_classes"]) == {"function", "LLMChain", "Chain"}
|
||||
assert set(chain["base_classes"]) == {
|
||||
"Serializable",
|
||||
"function",
|
||||
"LLMChain",
|
||||
"Chain"
|
||||
}
|
||||
|
||||
template = chain["template"]
|
||||
assert template["memory"] == {
|
||||
"required": False,
|
||||
|
|
@ -159,31 +166,14 @@ def test_llm_checker_chain(client: TestClient):
|
|||
chain = chains["LLMCheckerChain"]
|
||||
|
||||
# Test the base classes, template, memory, verbose, llm, input_key, output_key, and _type objects
|
||||
assert set(chain["base_classes"]) == {"function", "LLMCheckerChain", "Chain"}
|
||||
assert set(chain["base_classes"]) == {
|
||||
"Serializable",
|
||||
"function",
|
||||
"LLMCheckerChain",
|
||||
"Chain"
|
||||
}
|
||||
|
||||
template = chain["template"]
|
||||
assert template["memory"] == {
|
||||
"required": False,
|
||||
"placeholder": "",
|
||||
"show": True,
|
||||
"multiline": False,
|
||||
"password": False,
|
||||
"name": "memory",
|
||||
"type": "BaseMemory",
|
||||
"list": False,
|
||||
"advanced": False,
|
||||
}
|
||||
assert template["verbose"] == {
|
||||
"required": False,
|
||||
"placeholder": "",
|
||||
"show": True,
|
||||
"multiline": False,
|
||||
"value": False,
|
||||
"password": False,
|
||||
"name": "verbose",
|
||||
"type": "bool",
|
||||
"list": False,
|
||||
"advanced": True,
|
||||
}
|
||||
assert template["llm"] == {
|
||||
"required": True,
|
||||
"placeholder": "",
|
||||
|
|
@ -195,35 +185,11 @@ def test_llm_checker_chain(client: TestClient):
|
|||
"list": False,
|
||||
"advanced": False,
|
||||
}
|
||||
assert template["input_key"] == {
|
||||
"required": True,
|
||||
"placeholder": "",
|
||||
"show": True,
|
||||
"multiline": False,
|
||||
"value": "query",
|
||||
"password": False,
|
||||
"name": "input_key",
|
||||
"type": "str",
|
||||
"list": False,
|
||||
"advanced": True,
|
||||
}
|
||||
assert template["output_key"] == {
|
||||
"required": True,
|
||||
"placeholder": "",
|
||||
"show": True,
|
||||
"multiline": False,
|
||||
"value": "result",
|
||||
"password": False,
|
||||
"name": "output_key",
|
||||
"type": "str",
|
||||
"list": False,
|
||||
"advanced": True,
|
||||
}
|
||||
assert template["_type"] == "LLMCheckerChain"
|
||||
|
||||
# Test the description object
|
||||
assert (
|
||||
chain["description"] == "Chain for question-answering with self-verification."
|
||||
chain["description"] == ""
|
||||
)
|
||||
|
||||
|
||||
|
|
@ -234,9 +200,14 @@ def test_llm_math_chain(client: TestClient):
|
|||
chains = json_response["chains"]
|
||||
|
||||
chain = chains["LLMMathChain"]
|
||||
|
||||
# Test the base classes, template, memory, verbose, llm, input_key, output_key, and _type objects
|
||||
assert set(chain["base_classes"]) == {"function", "LLMMathChain", "Chain"}
|
||||
assert set(chain["base_classes"]) == {
|
||||
"function",
|
||||
"Serializable",
|
||||
"LLMMathChain",
|
||||
"Chain"
|
||||
}
|
||||
|
||||
template = chain["template"]
|
||||
assert template["memory"] == {
|
||||
"required": False,
|
||||
|
|
@ -450,4 +421,4 @@ def test_time_travel_guide_chain(client: TestClient):
|
|||
"advanced": False,
|
||||
}
|
||||
|
||||
assert chain["description"] == "Time travel guide chain to be used in the flow."
|
||||
assert chain["description"] == "Time travel guide chain."
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue