Update template files with new fileTypes field

This commit is contained in:
Gabriel Luiz Freitas Almeida 2023-12-09 23:23:14 -03:00
commit 628855c50d
4 changed files with 81 additions and 1 deletions

View file

@ -28,6 +28,8 @@ def test_zero_shot_agent(client: TestClient, logged_in_headers):
"list": True, "list": True,
"advanced": False, "advanced": False,
"info": "", "info": "",
"fileTypes": [],
"value": None,
} }
# Additional assertions for other template variables # Additional assertions for other template variables
@ -43,6 +45,8 @@ def test_zero_shot_agent(client: TestClient, logged_in_headers):
"list": False, "list": False,
"advanced": False, "advanced": False,
"info": "", "info": "",
"fileTypes": [],
"value": None,
} }
assert template["llm"] == { assert template["llm"] == {
"required": True, "required": True,
@ -56,6 +60,8 @@ def test_zero_shot_agent(client: TestClient, logged_in_headers):
"list": False, "list": False,
"advanced": False, "advanced": False,
"info": "", "info": "",
"fileTypes": [],
"value": None,
} }
assert template["output_parser"] == { assert template["output_parser"] == {
"required": False, "required": False,
@ -69,6 +75,8 @@ def test_zero_shot_agent(client: TestClient, logged_in_headers):
"list": False, "list": False,
"advanced": False, "advanced": False,
"info": "", "info": "",
"fileTypes": [],
"value": None,
} }
assert template["input_variables"] == { assert template["input_variables"] == {
"required": False, "required": False,
@ -82,6 +90,8 @@ def test_zero_shot_agent(client: TestClient, logged_in_headers):
"list": True, "list": True,
"advanced": False, "advanced": False,
"info": "", "info": "",
"fileTypes": [],
"value": None,
} }
assert template["prefix"] == { assert template["prefix"] == {
"required": False, "required": False,
@ -96,6 +106,7 @@ def test_zero_shot_agent(client: TestClient, logged_in_headers):
"list": False, "list": False,
"advanced": False, "advanced": False,
"info": "", "info": "",
"fileTypes": [],
} }
assert template["suffix"] == { assert template["suffix"] == {
"required": False, "required": False,
@ -110,6 +121,7 @@ def test_zero_shot_agent(client: TestClient, logged_in_headers):
"list": False, "list": False,
"advanced": False, "advanced": False,
"info": "", "info": "",
"fileTypes": [],
} }
@ -135,6 +147,9 @@ def test_json_agent(client: TestClient, logged_in_headers):
"list": False, "list": False,
"advanced": False, "advanced": False,
"info": "", "info": "",
"file_path": "",
"fileTypes": [],
"value": "",
} }
assert template["llm"] == { assert template["llm"] == {
"required": True, "required": True,
@ -149,6 +164,9 @@ def test_json_agent(client: TestClient, logged_in_headers):
"advanced": False, "advanced": False,
"display_name": "LLM", "display_name": "LLM",
"info": "", "info": "",
"file_path": "",
"fileTypes": [],
"value": "",
} }
@ -174,7 +192,7 @@ def test_csv_agent(client: TestClient, logged_in_headers):
"name": "path", "name": "path",
"type": "file", "type": "file",
"list": False, "list": False,
"file_path": None, "file_path": "",
"advanced": False, "advanced": False,
"info": "", "info": "",
} }
@ -191,4 +209,7 @@ def test_csv_agent(client: TestClient, logged_in_headers):
"advanced": False, "advanced": False,
"display_name": "LLM", "display_name": "LLM",
"info": "", "info": "",
"file_path": "",
"fileTypes": [],
"value": "",
} }

View file

@ -35,6 +35,7 @@ def test_llm_checker_chain(client: TestClient, logged_in_headers):
"list": False, "list": False,
"advanced": False, "advanced": False,
"info": "", "info": "",
"fileTypes": [],
} }
assert template["_type"] == "LLMCheckerChain" assert template["_type"] == "LLMCheckerChain"
@ -69,6 +70,7 @@ def test_llm_math_chain(client: TestClient, logged_in_headers):
"list": False, "list": False,
"advanced": False, "advanced": False,
"info": "", "info": "",
"fileTypes": [],
} }
assert template["verbose"] == { assert template["verbose"] == {
"required": False, "required": False,
@ -83,6 +85,7 @@ def test_llm_math_chain(client: TestClient, logged_in_headers):
"list": False, "list": False,
"advanced": True, "advanced": True,
"info": "", "info": "",
"fileTypes": [],
} }
assert template["llm"] == { assert template["llm"] == {
"required": True, "required": True,
@ -96,6 +99,7 @@ def test_llm_math_chain(client: TestClient, logged_in_headers):
"list": False, "list": False,
"advanced": False, "advanced": False,
"info": "", "info": "",
"fileTypes": [],
} }
assert template["input_key"] == { assert template["input_key"] == {
"required": True, "required": True,
@ -110,6 +114,7 @@ def test_llm_math_chain(client: TestClient, logged_in_headers):
"list": False, "list": False,
"advanced": True, "advanced": True,
"info": "", "info": "",
"fileTypes": [],
} }
assert template["output_key"] == { assert template["output_key"] == {
"required": True, "required": True,
@ -124,6 +129,7 @@ def test_llm_math_chain(client: TestClient, logged_in_headers):
"list": False, "list": False,
"advanced": True, "advanced": True,
"info": "", "info": "",
"fileTypes": [],
} }
assert template["_type"] == "LLMMathChain" assert template["_type"] == "LLMMathChain"
@ -163,6 +169,9 @@ def test_series_character_chain(client: TestClient, logged_in_headers):
"list": False, "list": False,
"advanced": False, "advanced": False,
"info": "", "info": "",
"fileTypes": [],
"file_path": "",
"value": "",
} }
assert template["character"] == { assert template["character"] == {
"required": True, "required": True,
@ -176,6 +185,9 @@ def test_series_character_chain(client: TestClient, logged_in_headers):
"list": False, "list": False,
"advanced": False, "advanced": False,
"info": "", "info": "",
"fileTypes": [],
"file_path": "",
"value": "",
} }
assert template["series"] == { assert template["series"] == {
"required": True, "required": True,
@ -189,6 +201,9 @@ def test_series_character_chain(client: TestClient, logged_in_headers):
"list": False, "list": False,
"advanced": False, "advanced": False,
"info": "", "info": "",
"fileTypes": [],
"file_path": "",
"value": "",
} }
assert template["_type"] == "SeriesCharacterChain" assert template["_type"] == "SeriesCharacterChain"
@ -232,6 +247,9 @@ def test_mid_journey_prompt_chain(client: TestClient, logged_in_headers):
"list": False, "list": False,
"advanced": False, "advanced": False,
"info": "", "info": "",
"file_path": "",
"fileTypes": [],
"value": "",
} }
# Test the description object # Test the description object
assert chain["description"] == "MidJourneyPromptChain is a chain you can use to generate new MidJourney prompts." assert chain["description"] == "MidJourneyPromptChain is a chain you can use to generate new MidJourney prompts."
@ -270,6 +288,9 @@ def test_time_travel_guide_chain(client: TestClient, logged_in_headers):
"list": False, "list": False,
"advanced": False, "advanced": False,
"info": "", "info": "",
"file_path": "",
"fileTypes": [],
"value": "",
} }
assert template["memory"] == { assert template["memory"] == {
"required": False, "required": False,
@ -283,6 +304,9 @@ def test_time_travel_guide_chain(client: TestClient, logged_in_headers):
"list": False, "list": False,
"advanced": False, "advanced": False,
"info": "", "info": "",
"file_path": "",
"fileTypes": [],
"value": "",
} }
assert chain["description"] == "Time travel guide chain." assert chain["description"] == "Time travel guide chain."

View file

@ -22,6 +22,7 @@ def test_openai(client: TestClient, logged_in_headers):
"list": False, "list": False,
"advanced": False, "advanced": False,
"info": "", "info": "",
"fileTypes": [],
} }
assert template["verbose"] == { assert template["verbose"] == {
"required": False, "required": False,
@ -35,6 +36,7 @@ def test_openai(client: TestClient, logged_in_headers):
"list": False, "list": False,
"advanced": False, "advanced": False,
"info": "", "info": "",
"fileTypes": [],
} }
assert template["client"] == { assert template["client"] == {
"required": False, "required": False,
@ -48,6 +50,7 @@ def test_openai(client: TestClient, logged_in_headers):
"list": False, "list": False,
"advanced": False, "advanced": False,
"info": "", "info": "",
"fileTypes": [],
} }
assert template["model_name"] == { assert template["model_name"] == {
"required": False, "required": False,
@ -69,6 +72,7 @@ def test_openai(client: TestClient, logged_in_headers):
"list": True, "list": True,
"advanced": False, "advanced": False,
"info": "", "info": "",
"fileTypes": [],
} }
# Add more assertions for other properties here # Add more assertions for other properties here
assert template["temperature"] == { assert template["temperature"] == {
@ -84,6 +88,7 @@ def test_openai(client: TestClient, logged_in_headers):
"list": False, "list": False,
"advanced": False, "advanced": False,
"info": "", "info": "",
"fileTypes": [],
} }
assert template["max_tokens"] == { assert template["max_tokens"] == {
"required": False, "required": False,
@ -98,6 +103,7 @@ def test_openai(client: TestClient, logged_in_headers):
"list": False, "list": False,
"advanced": False, "advanced": False,
"info": "", "info": "",
"fileTypes": [],
} }
assert template["top_p"] == { assert template["top_p"] == {
"required": False, "required": False,
@ -112,6 +118,7 @@ def test_openai(client: TestClient, logged_in_headers):
"list": False, "list": False,
"advanced": False, "advanced": False,
"info": "", "info": "",
"fileTypes": [],
} }
assert template["frequency_penalty"] == { assert template["frequency_penalty"] == {
"required": False, "required": False,
@ -126,6 +133,7 @@ def test_openai(client: TestClient, logged_in_headers):
"list": False, "list": False,
"advanced": False, "advanced": False,
"info": "", "info": "",
"fileTypes": [],
} }
assert template["presence_penalty"] == { assert template["presence_penalty"] == {
"required": False, "required": False,
@ -140,6 +148,7 @@ def test_openai(client: TestClient, logged_in_headers):
"list": False, "list": False,
"advanced": False, "advanced": False,
"info": "", "info": "",
"fileTypes": [],
} }
assert template["n"] == { assert template["n"] == {
"required": False, "required": False,
@ -154,6 +163,7 @@ def test_openai(client: TestClient, logged_in_headers):
"list": False, "list": False,
"advanced": False, "advanced": False,
"info": "", "info": "",
"fileTypes": [],
} }
assert template["best_of"] == { assert template["best_of"] == {
"required": False, "required": False,
@ -168,6 +178,7 @@ def test_openai(client: TestClient, logged_in_headers):
"list": False, "list": False,
"advanced": False, "advanced": False,
"info": "", "info": "",
"fileTypes": [],
} }
assert template["model_kwargs"] == { assert template["model_kwargs"] == {
"required": False, "required": False,
@ -181,6 +192,7 @@ def test_openai(client: TestClient, logged_in_headers):
"list": False, "list": False,
"advanced": True, "advanced": True,
"info": "", "info": "",
"fileTypes": [],
} }
assert template["openai_api_key"] == { assert template["openai_api_key"] == {
"required": False, "required": False,
@ -196,6 +208,7 @@ def test_openai(client: TestClient, logged_in_headers):
"list": False, "list": False,
"advanced": False, "advanced": False,
"info": "", "info": "",
"fileTypes": [],
} }
assert template["batch_size"] == { assert template["batch_size"] == {
"required": False, "required": False,
@ -210,6 +223,7 @@ def test_openai(client: TestClient, logged_in_headers):
"list": False, "list": False,
"advanced": False, "advanced": False,
"info": "", "info": "",
"fileTypes": [],
} }
assert template["request_timeout"] == { assert template["request_timeout"] == {
"required": False, "required": False,
@ -223,6 +237,7 @@ def test_openai(client: TestClient, logged_in_headers):
"list": False, "list": False,
"advanced": False, "advanced": False,
"info": "", "info": "",
"fileTypes": [],
} }
assert template["logit_bias"] == { assert template["logit_bias"] == {
"required": False, "required": False,
@ -236,6 +251,7 @@ def test_openai(client: TestClient, logged_in_headers):
"list": False, "list": False,
"advanced": False, "advanced": False,
"info": "", "info": "",
"fileTypes": [],
} }
assert template["max_retries"] == { assert template["max_retries"] == {
"required": False, "required": False,
@ -250,6 +266,7 @@ def test_openai(client: TestClient, logged_in_headers):
"list": False, "list": False,
"advanced": False, "advanced": False,
"info": "", "info": "",
"fileTypes": [],
} }
assert template["streaming"] == { assert template["streaming"] == {
"required": False, "required": False,
@ -264,6 +281,7 @@ def test_openai(client: TestClient, logged_in_headers):
"list": False, "list": False,
"advanced": False, "advanced": False,
"info": "", "info": "",
"fileTypes": [],
} }
@ -289,6 +307,7 @@ def test_chat_open_ai(client: TestClient, logged_in_headers):
"list": False, "list": False,
"advanced": False, "advanced": False,
"info": "", "info": "",
"fileTypes": [],
} }
assert template["client"] == { assert template["client"] == {
"required": False, "required": False,
@ -302,6 +321,7 @@ def test_chat_open_ai(client: TestClient, logged_in_headers):
"list": False, "list": False,
"advanced": False, "advanced": False,
"info": "", "info": "",
"fileTypes": [],
} }
assert template["model_name"] == { assert template["model_name"] == {
"required": False, "required": False,
@ -324,6 +344,7 @@ def test_chat_open_ai(client: TestClient, logged_in_headers):
"list": True, "list": True,
"advanced": False, "advanced": False,
"info": "", "info": "",
"fileTypes": [],
} }
assert template["temperature"] == { assert template["temperature"] == {
"required": False, "required": False,
@ -338,6 +359,7 @@ def test_chat_open_ai(client: TestClient, logged_in_headers):
"list": False, "list": False,
"advanced": False, "advanced": False,
"info": "", "info": "",
"fileTypes": [],
} }
assert template["model_kwargs"] == { assert template["model_kwargs"] == {
"required": False, "required": False,
@ -351,6 +373,7 @@ def test_chat_open_ai(client: TestClient, logged_in_headers):
"list": False, "list": False,
"advanced": True, "advanced": True,
"info": "", "info": "",
"fileTypes": [],
} }
assert template["openai_api_key"] == { assert template["openai_api_key"] == {
"required": False, "required": False,
@ -366,6 +389,7 @@ def test_chat_open_ai(client: TestClient, logged_in_headers):
"list": False, "list": False,
"advanced": False, "advanced": False,
"info": "", "info": "",
"fileTypes": [],
} }
assert template["request_timeout"] == { assert template["request_timeout"] == {
"required": False, "required": False,
@ -379,6 +403,7 @@ def test_chat_open_ai(client: TestClient, logged_in_headers):
"list": False, "list": False,
"advanced": False, "advanced": False,
"info": "", "info": "",
"fileTypes": [],
} }
assert template["max_retries"] == { assert template["max_retries"] == {
"required": False, "required": False,
@ -393,6 +418,7 @@ def test_chat_open_ai(client: TestClient, logged_in_headers):
"list": False, "list": False,
"advanced": False, "advanced": False,
"info": "", "info": "",
"fileTypes": [],
} }
assert template["streaming"] == { assert template["streaming"] == {
"required": False, "required": False,
@ -407,6 +433,7 @@ def test_chat_open_ai(client: TestClient, logged_in_headers):
"list": False, "list": False,
"advanced": False, "advanced": False,
"info": "", "info": "",
"fileTypes": [],
} }
assert template["n"] == { assert template["n"] == {
"required": False, "required": False,
@ -421,6 +448,7 @@ def test_chat_open_ai(client: TestClient, logged_in_headers):
"list": False, "list": False,
"advanced": False, "advanced": False,
"info": "", "info": "",
"fileTypes": [],
} }
assert template["max_tokens"] == { assert template["max_tokens"] == {
@ -435,6 +463,7 @@ def test_chat_open_ai(client: TestClient, logged_in_headers):
"list": False, "list": False,
"advanced": False, "advanced": False,
"info": "", "info": "",
"fileTypes": [],
} }
assert template["_type"] == "ChatOpenAI" assert template["_type"] == "ChatOpenAI"
assert ( assert (

View file

@ -31,6 +31,7 @@ def test_prompt_template(client: TestClient, logged_in_headers):
"list": True, "list": True,
"advanced": False, "advanced": False,
"info": "", "info": "",
"fileTypes": [],
} }
assert template["output_parser"] == { assert template["output_parser"] == {
@ -45,6 +46,7 @@ def test_prompt_template(client: TestClient, logged_in_headers):
"list": False, "list": False,
"advanced": False, "advanced": False,
"info": "", "info": "",
"fileTypes": [],
} }
assert template["partial_variables"] == { assert template["partial_variables"] == {
@ -59,6 +61,7 @@ def test_prompt_template(client: TestClient, logged_in_headers):
"list": False, "list": False,
"advanced": False, "advanced": False,
"info": "", "info": "",
"fileTypes": [],
} }
assert template["template"] == { assert template["template"] == {
@ -73,6 +76,7 @@ def test_prompt_template(client: TestClient, logged_in_headers):
"list": False, "list": False,
"advanced": False, "advanced": False,
"info": "", "info": "",
"fileTypes": [],
} }
assert template["template_format"] == { assert template["template_format"] == {
@ -88,6 +92,7 @@ def test_prompt_template(client: TestClient, logged_in_headers):
"list": False, "list": False,
"advanced": False, "advanced": False,
"info": "", "info": "",
"fileTypes": [],
} }
assert template["validate_template"] == { assert template["validate_template"] == {
@ -103,4 +108,5 @@ def test_prompt_template(client: TestClient, logged_in_headers):
"list": False, "list": False,
"advanced": False, "advanced": False,
"info": "", "info": "",
"fileTypes": [],
} }