From 1880484a6ca5b496bd2941ab6bed2b443b2cda53 Mon Sep 17 00:00:00 2001 From: Gabriel Luiz Freitas Almeida Date: Tue, 27 Jun 2023 13:25:59 -0300 Subject: [PATCH] fix: add info field to tests --- tests/test_agents_template.py | 10 ++++++++++ tests/test_chains_template.py | 21 +++++++++++++++++++++ tests/test_llms_template.py | 29 +++++++++++++++++++++++++++++ tests/test_prompts_template.py | 9 +++++++++ 4 files changed, 69 insertions(+) diff --git a/tests/test_agents_template.py b/tests/test_agents_template.py index 0497283b9..bf89f9996 100644 --- a/tests/test_agents_template.py +++ b/tests/test_agents_template.py @@ -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": "", } diff --git a/tests/test_chains_template.py b/tests/test_chains_template.py index cba973272..63e236018 100644 --- a/tests/test_chains_template.py +++ b/tests/test_chains_template.py @@ -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." diff --git a/tests/test_llms_template.py b/tests/test_llms_template.py index 3f8c09079..859b722e1 100644 --- a/tests/test_llms_template.py +++ b/tests/test_llms_template.py @@ -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 ( diff --git a/tests/test_prompts_template.py b/tests/test_prompts_template.py index 5094f50f0..4e6030cab 100644 --- a/tests/test_prompts_template.py +++ b/tests/test_prompts_template.py @@ -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": "", }