fix: add info field to tests

This commit is contained in:
Gabriel Luiz Freitas Almeida 2023-06-27 13:25:59 -03:00
commit 1880484a6c
4 changed files with 69 additions and 0 deletions

View file

@ -26,6 +26,7 @@ def test_zero_shot_agent(client: TestClient):
"type": "LLMChain",
"list": False,
"advanced": False,
"info": "",
}
assert template["allowed_tools"] == {
"required": False,
@ -37,6 +38,7 @@ def test_zero_shot_agent(client: TestClient):
"type": "Tool",
"list": True,
"advanced": False,
"info": "",
}
@ -60,6 +62,7 @@ def test_json_agent(client: TestClient):
"type": "BaseToolkit",
"list": False,
"advanced": False,
"info": "",
}
assert template["llm"] == {
"required": True,
@ -72,6 +75,7 @@ def test_json_agent(client: TestClient):
"list": False,
"advanced": False,
"display_name": "LLM",
"info": "",
}
@ -99,6 +103,7 @@ def test_csv_agent(client: TestClient):
"list": False,
"file_path": None,
"advanced": False,
"info": "",
}
assert template["llm"] == {
"required": True,
@ -111,6 +116,7 @@ def test_csv_agent(client: TestClient):
"list": False,
"advanced": False,
"display_name": "LLM",
"info": "",
}
@ -143,6 +149,7 @@ def test_initialize_agent(client: TestClient):
"type": "str",
"list": True,
"advanced": False,
"info": "",
}
assert template["memory"] == {
"required": False,
@ -154,6 +161,7 @@ def test_initialize_agent(client: TestClient):
"type": "BaseChatMemory",
"list": False,
"advanced": False,
"info": "",
}
assert template["tools"] == {
"required": False,
@ -165,6 +173,7 @@ def test_initialize_agent(client: TestClient):
"type": "Tool",
"list": True,
"advanced": False,
"info": "",
}
assert template["llm"] == {
"required": True,
@ -177,4 +186,5 @@ def test_initialize_agent(client: TestClient):
"list": False,
"advanced": False,
"display_name": "LLM",
"info": "",
}

View file

@ -38,6 +38,7 @@ def test_conversation_chain(client: TestClient):
"type": "BaseMemory",
"list": False,
"advanced": False,
"info": "",
}
assert template["verbose"] == {
"required": False,
@ -49,6 +50,7 @@ def test_conversation_chain(client: TestClient):
"type": "bool",
"list": False,
"advanced": True,
"info": "",
}
assert template["llm"] == {
"required": True,
@ -60,6 +62,7 @@ def test_conversation_chain(client: TestClient):
"type": "BaseLanguageModel",
"list": False,
"advanced": False,
"info": "",
}
assert template["input_key"] == {
"required": True,
@ -72,6 +75,7 @@ def test_conversation_chain(client: TestClient):
"type": "str",
"list": False,
"advanced": True,
"info": "",
}
assert template["output_key"] == {
"required": True,
@ -84,6 +88,7 @@ def test_conversation_chain(client: TestClient):
"type": "str",
"list": False,
"advanced": True,
"info": "",
}
assert template["_type"] == "ConversationChain"
@ -120,6 +125,7 @@ def test_llm_chain(client: TestClient):
"type": "BaseMemory",
"list": False,
"advanced": False,
"info": "",
}
assert template["verbose"] == {
"required": False,
@ -132,6 +138,7 @@ def test_llm_chain(client: TestClient):
"type": "bool",
"list": False,
"advanced": True,
"info": "",
}
assert template["llm"] == {
"required": True,
@ -143,6 +150,7 @@ def test_llm_chain(client: TestClient):
"type": "BaseLanguageModel",
"list": False,
"advanced": False,
"info": "",
}
assert template["output_key"] == {
"required": True,
@ -155,6 +163,7 @@ def test_llm_chain(client: TestClient):
"type": "str",
"list": False,
"advanced": True,
"info": "",
}
@ -184,6 +193,7 @@ def test_llm_checker_chain(client: TestClient):
"type": "BaseLanguageModel",
"list": False,
"advanced": False,
"info": "",
}
assert template["_type"] == "LLMCheckerChain"
@ -217,6 +227,7 @@ def test_llm_math_chain(client: TestClient):
"type": "BaseMemory",
"list": False,
"advanced": False,
"info": "",
}
assert template["verbose"] == {
"required": False,
@ -229,6 +240,7 @@ def test_llm_math_chain(client: TestClient):
"type": "bool",
"list": False,
"advanced": True,
"info": "",
}
assert template["llm"] == {
"required": True,
@ -240,6 +252,7 @@ def test_llm_math_chain(client: TestClient):
"type": "BaseLanguageModel",
"list": False,
"advanced": False,
"info": "",
}
assert template["input_key"] == {
"required": True,
@ -252,6 +265,7 @@ def test_llm_math_chain(client: TestClient):
"type": "str",
"list": False,
"advanced": True,
"info": "",
}
assert template["output_key"] == {
"required": True,
@ -264,6 +278,7 @@ def test_llm_math_chain(client: TestClient):
"type": "str",
"list": False,
"advanced": True,
"info": "",
}
assert template["_type"] == "LLMMathChain"
@ -304,6 +319,7 @@ def test_series_character_chain(client: TestClient):
"type": "BaseLanguageModel",
"list": False,
"advanced": False,
"info": "",
}
assert template["character"] == {
"required": True,
@ -315,6 +331,7 @@ def test_series_character_chain(client: TestClient):
"type": "str",
"list": False,
"advanced": False,
"info": "",
}
assert template["series"] == {
"required": True,
@ -326,6 +343,7 @@ def test_series_character_chain(client: TestClient):
"type": "str",
"list": False,
"advanced": False,
"info": "",
}
assert template["_type"] == "SeriesCharacterChain"
@ -367,6 +385,7 @@ def test_mid_journey_prompt_chain(client: TestClient):
"type": "BaseLanguageModel",
"list": False,
"advanced": False,
"info": "",
}
# Test the description object
assert (
@ -406,6 +425,7 @@ def test_time_travel_guide_chain(client: TestClient):
"type": "BaseLanguageModel",
"list": False,
"advanced": False,
"info": "",
}
assert template["memory"] == {
"required": False,
@ -417,6 +437,7 @@ def test_time_travel_guide_chain(client: TestClient):
"type": "BaseChatMemory",
"list": False,
"advanced": False,
"info": "",
}
assert chain["description"] == "Time travel guide chain."

View file

@ -121,6 +121,7 @@ def test_openai(client: TestClient):
"type": "bool",
"list": False,
"advanced": False,
"info": "",
}
assert template["verbose"] == {
"required": False,
@ -132,6 +133,7 @@ def test_openai(client: TestClient):
"type": "bool",
"list": False,
"advanced": False,
"info": "",
}
assert template["client"] == {
"required": False,
@ -143,6 +145,7 @@ def test_openai(client: TestClient):
"type": "Any",
"list": False,
"advanced": False,
"info": "",
}
assert template["model_name"] == {
"required": False,
@ -162,6 +165,7 @@ def test_openai(client: TestClient):
"type": "str",
"list": True,
"advanced": False,
"info": "",
}
# Add more assertions for other properties here
assert template["temperature"] == {
@ -175,6 +179,7 @@ def test_openai(client: TestClient):
"type": "float",
"list": False,
"advanced": False,
"info": "",
}
assert template["max_tokens"] == {
"required": False,
@ -187,6 +192,7 @@ def test_openai(client: TestClient):
"type": "int",
"list": False,
"advanced": False,
"info": "",
}
assert template["top_p"] == {
"required": False,
@ -199,6 +205,7 @@ def test_openai(client: TestClient):
"type": "float",
"list": False,
"advanced": False,
"info": "",
}
assert template["frequency_penalty"] == {
"required": False,
@ -211,6 +218,7 @@ def test_openai(client: TestClient):
"type": "float",
"list": False,
"advanced": False,
"info": "",
}
assert template["presence_penalty"] == {
"required": False,
@ -223,6 +231,7 @@ def test_openai(client: TestClient):
"type": "float",
"list": False,
"advanced": False,
"info": "",
}
assert template["n"] == {
"required": False,
@ -235,6 +244,7 @@ def test_openai(client: TestClient):
"type": "int",
"list": False,
"advanced": False,
"info": "",
}
assert template["best_of"] == {
"required": False,
@ -247,6 +257,7 @@ def test_openai(client: TestClient):
"type": "int",
"list": False,
"advanced": False,
"info": "",
}
assert template["model_kwargs"] == {
"required": False,
@ -258,6 +269,7 @@ def test_openai(client: TestClient):
"type": "code",
"list": False,
"advanced": True,
"info": "",
}
assert template["openai_api_key"] == {
"required": False,
@ -271,6 +283,7 @@ def test_openai(client: TestClient):
"type": "str",
"list": False,
"advanced": False,
"info": "",
}
assert template["batch_size"] == {
"required": False,
@ -283,6 +296,7 @@ def test_openai(client: TestClient):
"type": "int",
"list": False,
"advanced": False,
"info": "",
}
assert template["request_timeout"] == {
"required": False,
@ -294,6 +308,7 @@ def test_openai(client: TestClient):
"type": "float",
"list": False,
"advanced": False,
"info": "",
}
assert template["logit_bias"] == {
"required": False,
@ -305,6 +320,7 @@ def test_openai(client: TestClient):
"type": "code",
"list": False,
"advanced": False,
"info": "",
}
assert template["max_retries"] == {
"required": False,
@ -317,6 +333,7 @@ def test_openai(client: TestClient):
"type": "int",
"list": False,
"advanced": False,
"info": "",
}
assert template["streaming"] == {
"required": False,
@ -329,6 +346,7 @@ def test_openai(client: TestClient):
"type": "bool",
"list": False,
"advanced": False,
"info": "",
}
@ -352,6 +370,7 @@ def test_chat_open_ai(client: TestClient):
"type": "bool",
"list": False,
"advanced": False,
"info": "",
}
assert template["client"] == {
"required": False,
@ -363,6 +382,7 @@ def test_chat_open_ai(client: TestClient):
"type": "Any",
"list": False,
"advanced": False,
"info": "",
}
assert template["model_name"] == {
"required": False,
@ -385,6 +405,7 @@ def test_chat_open_ai(client: TestClient):
"type": "str",
"list": True,
"advanced": False,
"info": "",
}
assert template["temperature"] == {
"required": False,
@ -397,6 +418,7 @@ def test_chat_open_ai(client: TestClient):
"type": "float",
"list": False,
"advanced": False,
"info": "",
}
assert template["model_kwargs"] == {
"required": False,
@ -408,6 +430,7 @@ def test_chat_open_ai(client: TestClient):
"type": "code",
"list": False,
"advanced": True,
"info": "",
}
assert template["openai_api_key"] == {
"required": False,
@ -421,6 +444,7 @@ def test_chat_open_ai(client: TestClient):
"type": "str",
"list": False,
"advanced": False,
"info": "",
}
assert template["request_timeout"] == {
"required": False,
@ -432,6 +456,7 @@ def test_chat_open_ai(client: TestClient):
"type": "float",
"list": False,
"advanced": False,
"info": "",
}
assert template["max_retries"] == {
"required": False,
@ -444,6 +469,7 @@ def test_chat_open_ai(client: TestClient):
"type": "int",
"list": False,
"advanced": False,
"info": "",
}
assert template["streaming"] == {
"required": False,
@ -456,6 +482,7 @@ def test_chat_open_ai(client: TestClient):
"type": "bool",
"list": False,
"advanced": False,
"info": "",
}
assert template["n"] == {
"required": False,
@ -468,6 +495,7 @@ def test_chat_open_ai(client: TestClient):
"type": "int",
"list": False,
"advanced": False,
"info": "",
}
assert template["max_tokens"] == {
@ -480,6 +508,7 @@ def test_chat_open_ai(client: TestClient):
"type": "int",
"list": False,
"advanced": False,
"info": "",
}
assert template["_type"] == "ChatOpenAI"
assert (

View file

@ -28,6 +28,7 @@ def test_prompt_template(client: TestClient):
"type": "str",
"list": True,
"advanced": False,
"info": "",
}
assert template["output_parser"] == {
"required": False,
@ -39,6 +40,7 @@ def test_prompt_template(client: TestClient):
"type": "BaseOutputParser",
"list": False,
"advanced": False,
"info": "",
}
assert template["partial_variables"] == {
"required": False,
@ -50,6 +52,7 @@ def test_prompt_template(client: TestClient):
"type": "code",
"list": False,
"advanced": False,
"info": "",
}
assert template["template"] == {
"required": True,
@ -61,6 +64,7 @@ def test_prompt_template(client: TestClient):
"type": "prompt",
"list": False,
"advanced": False,
"info": "",
}
assert template["template_format"] == {
"required": False,
@ -73,6 +77,7 @@ def test_prompt_template(client: TestClient):
"type": "str",
"list": False,
"advanced": False,
"info": "",
}
assert template["validate_template"] == {
"required": False,
@ -85,6 +90,7 @@ def test_prompt_template(client: TestClient):
"type": "bool",
"list": False,
"advanced": False,
"info": "",
}
@ -106,6 +112,7 @@ def test_zero_shot_prompt(client: TestClient):
"type": "prompt",
"list": False,
"advanced": False,
"info": "",
}
assert template["suffix"] == {
"required": True,
@ -118,6 +125,7 @@ def test_zero_shot_prompt(client: TestClient):
"type": "prompt",
"list": False,
"advanced": False,
"info": "",
}
assert template["format_instructions"] == {
"required": True,
@ -130,4 +138,5 @@ def test_zero_shot_prompt(client: TestClient):
"type": "prompt",
"list": False,
"advanced": False,
"info": "",
}