From 5683f23ff99986b757ca5eb8f6ffa51bdc9976f2 Mon Sep 17 00:00:00 2001 From: Gabriel Almeida Date: Thu, 6 Apr 2023 13:52:59 -0300 Subject: [PATCH 1/3] feat: chain template tests --- tests/test_chains_template.py | 656 ++++++++++++++++++++++++++++++++++ 1 file changed, 656 insertions(+) create mode 100644 tests/test_chains_template.py diff --git a/tests/test_chains_template.py b/tests/test_chains_template.py new file mode 100644 index 000000000..1dfbe8da5 --- /dev/null +++ b/tests/test_chains_template.py @@ -0,0 +1,656 @@ +import pytest +from fastapi.testclient import TestClient + + +# Test the ConversationChain object +def test_conversation_chain(client: TestClient): + response = client.get("/all") + assert response.status_code == 200 + json_response = response.json() + 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"]) == {"LLMChain", "ConversationChain", "Chain"} + template = chain["template"] + assert template["memory"] == { + "required": False, + "placeholder": "", + "show": True, + "multiline": False, + "password": False, + "name": "memory", + "type": "BaseMemory", + "list": False, + } + assert template["verbose"] == { + "required": False, + "placeholder": "", + "show": False, + "multiline": False, + "password": False, + "name": "verbose", + "type": "bool", + "list": False, + } + assert template["llm"] == { + "required": True, + "placeholder": "", + "show": True, + "multiline": False, + "password": False, + "name": "llm", + "type": "BaseLanguageModel", + "list": False, + } + assert template["input_key"] == { + "required": False, + "placeholder": "", + "show": False, + "multiline": False, + "value": "input", + "password": True, + "name": "input_key", + "type": "str", + "list": False, + } + assert template["output_key"] == { + "required": False, + "placeholder": "", + "show": False, + "multiline": False, + "value": "response", + "password": True, + "name": "output_key", + "type": "str", + "list": False, + } + assert template["_type"] == "ConversationChain" + + # Test the description object + assert ( + chain["description"] + == "Chain to have a conversation and load context from memory." + ) + + +def test_llm_chain(client: TestClient): + response = client.get("/all") + assert response.status_code == 200 + json_response = response.json() + chains = json_response["chains"] + chain = chains["LLMChain"] + + # Test the base classes, template, memory, verbose, llm, input_key, output_key, and _type objects + assert set(chain["base_classes"]) == {"LLMChain", "Chain"} + template = chain["template"] + assert template["memory"] == { + "required": False, + "placeholder": "", + "show": True, + "multiline": False, + "password": False, + "name": "memory", + "type": "BaseMemory", + "list": False, + } + assert template["verbose"] == { + "required": False, + "placeholder": "", + "show": False, + "multiline": False, + "value": False, + "password": False, + "name": "verbose", + "type": "bool", + "list": False, + } + assert template["llm"] == { + "required": True, + "placeholder": "", + "show": True, + "multiline": False, + "password": False, + "name": "llm", + "type": "BaseLanguageModel", + "list": False, + } + assert template["output_key"] == { + "required": False, + "placeholder": "", + "show": False, + "multiline": False, + "value": "text", + "password": True, + "name": "output_key", + "type": "str", + "list": False, + } + + +def test_llm_checker_chain(client: TestClient): + response = client.get("/all") + assert response.status_code == 200 + json_response = response.json() + chains = json_response["chains"] + chain = chains["LLMCheckerChain"] + + # Test the base classes, template, memory, verbose, llm, input_key, output_key, and _type objects + assert set(chain["base_classes"]) == {"LLMCheckerChain", "Chain"} + template = chain["template"] + assert template["memory"] == { + "required": False, + "placeholder": "", + "show": True, + "multiline": False, + "password": False, + "name": "memory", + "type": "BaseMemory", + "list": False, + } + assert template["verbose"] == { + "required": False, + "placeholder": "", + "show": False, + "multiline": False, + "value": False, + "password": False, + "name": "verbose", + "type": "bool", + "list": False, + } + assert template["llm"] == { + "required": True, + "placeholder": "", + "show": True, + "multiline": False, + "password": False, + "name": "llm", + "type": "BaseLLM", + "list": False, + } + assert template["input_key"] == { + "required": False, + "placeholder": "", + "show": False, + "multiline": False, + "value": "query", + "password": True, + "name": "input_key", + "type": "str", + "list": False, + } + assert template["output_key"] == { + "required": False, + "placeholder": "", + "show": False, + "multiline": False, + "value": "result", + "password": True, + "name": "output_key", + "type": "str", + "list": False, + } + assert template["_type"] == "LLMCheckerChain" + + # Test the description object + assert ( + chain["description"] == "Chain for question-answering with self-verification." + ) + + +def test_llm_math_chain(client: TestClient): + response = client.get("/all") + assert response.status_code == 200 + json_response = response.json() + 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"]) == {"LLMMathChain", "Chain"} + template = chain["template"] + assert template["memory"] == { + "required": False, + "placeholder": "", + "show": True, + "multiline": False, + "password": False, + "name": "memory", + "type": "BaseMemory", + "list": False, + } + assert template["verbose"] == { + "required": False, + "placeholder": "", + "show": False, + "multiline": False, + "value": False, + "password": False, + "name": "verbose", + "type": "bool", + "list": False, + } + assert template["llm"] == { + "required": True, + "placeholder": "", + "show": True, + "multiline": False, + "password": False, + "name": "llm", + "type": "BaseLanguageModel", + "list": False, + } + assert template["input_key"] == { + "required": False, + "placeholder": "", + "show": False, + "multiline": False, + "value": "question", + "password": True, + "name": "input_key", + "type": "str", + "list": False, + } + assert template["output_key"] == { + "required": False, + "placeholder": "", + "show": False, + "multiline": False, + "value": "answer", + "password": True, + "name": "output_key", + "type": "str", + "list": False, + } + assert template["_type"] == "LLMMathChain" + + # Test the description object + assert ( + chain["description"] + == "Chain that interprets a prompt and executes python code to do math." + ) + + +def test_series_character_chain(client: TestClient): + response = client.get("/all") + assert response.status_code == 200 + json_response = response.json() + chains = json_response["chains"] + + chain = chains["SeriesCharacterChain"] + + # Test the base classes, template, memory, verbose, llm, input_key, output_key, and _type objects + assert set(chain["base_classes"]) == { + "LLMChain", + "BaseCustomChain", + "Chain", + "ConversationChain", + "SeriesCharacterChain", + } + template = chain["template"] + assert template["memory"] == { + "required": False, + "placeholder": "", + "show": True, + "multiline": False, + "value": { + "chat_memory": {"messages": []}, + "output_key": None, + "input_key": None, + "return_messages": False, + "human_prefix": "Human", + "ai_prefix": "AI", + "memory_key": "history", + }, + "password": False, + "name": "memory", + "type": "BaseMemory", + "list": False, + } + assert template["verbose"] == { + "required": False, + "placeholder": "", + "show": False, + "multiline": False, + "password": False, + "name": "verbose", + "type": "bool", + "list": False, + } + assert template["llm"] == { + "required": True, + "placeholder": "", + "show": True, + "multiline": False, + "password": False, + "name": "llm", + "type": "BaseLanguageModel", + "list": False, + } + assert template["input_key"] == { + "required": False, + "placeholder": "", + "show": False, + "multiline": False, + "value": "input", + "password": True, + "name": "input_key", + "type": "str", + "list": False, + } + assert template["output_key"] == { + "required": False, + "placeholder": "", + "show": False, + "multiline": False, + "value": "response", + "password": True, + "name": "output_key", + "type": "str", + "list": False, + } + assert template["template"] == { + "required": False, + "placeholder": "", + "show": False, + "multiline": True, + "value": "I want you to act like {character} from {series}.\nI want you to respond and answer like {character}. do not write any explanations. only answer like {character}.\nYou must know all of the knowledge of {character}.\nCurrent conversation:\n{history}\nHuman: {input}\n{character}:", + "password": False, + "name": "template", + "type": "str", + "list": False, + } + assert template["ai_prefix_key"] == { + "required": False, + "placeholder": "", + "show": False, + "multiline": False, + "value": "character", + "password": True, + "name": "ai_prefix_key", + "type": "str", + "list": False, + } + assert template["character"] == { + "required": True, + "placeholder": "", + "show": True, + "multiline": False, + "password": False, + "name": "character", + "type": "str", + "list": False, + } + assert template["series"] == { + "required": True, + "placeholder": "", + "show": True, + "multiline": False, + "password": False, + "name": "series", + "type": "str", + "list": False, + } + assert template["_type"] == "SeriesCharacterChain" + + # Test the description object + assert ( + chain["description"] + == "SeriesCharacterChain is a chain you can use to have a conversation with a character from a series." + ) + + +def test_mid_journey_prompt_chain(client: TestClient): + response = client.get("/all") + assert response.status_code == 200 + json_response = response.json() + chains = json_response["chains"] + chain = chains["MidJourneyPromptChain"] + assert isinstance(chain, dict) + + # Test the base_classes object + assert set(chain["base_classes"]) == { + "LLMChain", + "BaseCustomChain", + "Chain", + "ConversationChain", + "MidJourneyPromptChain", + } + + # Test the template object + template = chain["template"] + assert template["memory"] == { + "required": False, + "placeholder": "", + "show": True, + "multiline": False, + "value": { + "chat_memory": {"messages": []}, + "output_key": None, + "input_key": None, + "return_messages": False, + "human_prefix": "Human", + "ai_prefix": "AI", + "memory_key": "history", + }, + "password": False, + "name": "memory", + "type": "BaseMemory", + "list": False, + } + assert template["verbose"] == { + "required": False, + "placeholder": "", + "show": False, + "multiline": False, + "password": False, + "name": "verbose", + "type": "bool", + "list": False, + } + # Continue with other template object assertions + assert template["prompt"] == { + "required": False, + "placeholder": "", + "show": False, + "multiline": False, + "value": { + "input_variables": ["history", "input"], + "output_parser": None, + "partial_variables": {}, + "template": "The following is a friendly conversation between a human and an AI. The AI is talkative and provides lots of specific details from its context. If the AI does not know the answer to a question, it truthfully says it does not know.\n\nCurrent conversation:\n{history}\nHuman: {input}\nAI:", + "template_format": "f-string", + "validate_template": True, + "_type": "prompt", + }, + "password": False, + "name": "prompt", + "type": "BasePromptTemplate", + "list": False, + } + assert template["llm"] == { + "required": True, + "placeholder": "", + "show": True, + "multiline": False, + "password": False, + "name": "llm", + "type": "BaseLanguageModel", + "list": False, + } + assert template["output_key"] == { + "required": False, + "placeholder": "", + "show": False, + "multiline": False, + "value": "response", + "password": True, + "name": "output_key", + "type": "str", + "list": False, + } + assert template["input_key"] == { + "required": False, + "placeholder": "", + "show": False, + "multiline": False, + "value": "input", + "password": True, + "name": "input_key", + "type": "str", + "list": False, + } + assert template["template"] == { + "required": False, + "placeholder": "", + "show": False, + "multiline": True, + "value": 'I want you to act as a prompt generator for Midjourney\'s artificial intelligence program.\n Your job is to provide detailed and creative descriptions that will inspire unique and interesting images from the AI.\n Keep in mind that the AI is capable of understanding a wide range of language and can interpret abstract concepts, so feel free to be as imaginative and descriptive as possible.\n For example, you could describe a scene from a futuristic city, or a surreal landscape filled with strange creatures.\n The more detailed and imaginative your description, the more interesting the resulting image will be. Here is your first prompt:\n "A field of wildflowers stretches out as far as the eye can see, each one a different color and shape. In the distance, a massive tree towers over the landscape, its branches reaching up to the sky like tentacles."\n\n Current conversation:\n {history}\n Human: {input}\n AI:', + "password": False, + "name": "template", + "type": "str", + "list": False, + } + assert template["ai_prefix_key"] == { + "required": False, + "placeholder": "", + "show": False, + "multiline": False, + "password": True, + "name": "ai_prefix_key", + "type": "str", + "list": False, + } + # Test the description object + assert ( + chain["description"] + == "MidJourneyPromptChain is a chain you can use to generate new MidJourney prompts." + ) + + +def test_time_travel_guide_chain(client: TestClient): + response = client.get("/all") + assert response.status_code == 200 + json_response = response.json() + chains = json_response["chains"] + chain = chains["TimeTravelGuideChain"] + assert isinstance(chain, dict) + + # Test the base_classes object + assert set(chain["base_classes"]) == { + "LLMChain", + "BaseCustomChain", + "TimeTravelGuideChain", + "Chain", + "ConversationChain", + } + + # Test the template object + template = chain["template"] + assert template["memory"] == { + "required": False, + "placeholder": "", + "show": True, + "multiline": False, + "value": { + "chat_memory": {"messages": []}, + "output_key": None, + "input_key": None, + "return_messages": False, + "human_prefix": "Human", + "ai_prefix": "AI", + "memory_key": "history", + }, + "password": False, + "name": "memory", + "type": "BaseMemory", + "list": False, + } + assert template["verbose"] == { + "required": False, + "placeholder": "", + "show": False, + "multiline": False, + "password": False, + "name": "verbose", + "type": "bool", + "list": False, + } + + assert template["prompt"] == { + "required": False, + "placeholder": "", + "show": False, + "multiline": False, + "value": { + "input_variables": ["history", "input"], + "output_parser": None, + "partial_variables": {}, + "template": "The following is a friendly conversation between a human and an AI. The AI is talkative and provides lots of specific details from its context. If the AI does not know the answer to a question, it truthfully says it does not know.\n\nCurrent conversation:\n{history}\nHuman: {input}\nAI:", + "template_format": "f-string", + "validate_template": True, + "_type": "prompt", + }, + "password": False, + "name": "prompt", + "type": "BasePromptTemplate", + "list": False, + } + assert template["llm"] == { + "required": True, + "placeholder": "", + "show": True, + "multiline": False, + "password": False, + "name": "llm", + "type": "BaseLanguageModel", + "list": False, + } + assert template["output_key"] == { + "required": False, + "placeholder": "", + "show": False, + "multiline": False, + "value": "response", + "password": True, + "name": "output_key", + "type": "str", + "list": False, + } + + assert template["input_key"] == { + "required": False, + "placeholder": "", + "show": False, + "multiline": False, + "value": "input", + "password": True, + "name": "input_key", + "type": "str", + "list": False, + } + + assert template["template"] == { + "required": False, + "placeholder": "", + "show": False, + "multiline": True, + "value": "I want you to act as my time travel guide. You are helpful and creative. I will provide you with the historical period or future time I want to visit and you will suggest the best events, sights, or people to experience. Provide the suggestions and any necessary information.\n Current conversation:\n {history}\n Human: {input}\n AI:", + "password": False, + "name": "template", + "type": "str", + "list": False, + } + assert template["ai_prefix_key"] == { + "required": False, + "placeholder": "", + "show": False, + "multiline": False, + "password": True, + "name": "ai_prefix_key", + "type": "str", + "list": False, + } + assert chain["description"] == "" From f492eed3727e72794bcd15a44337707ea8515ff9 Mon Sep 17 00:00:00 2001 From: Gabriel Almeida Date: Thu, 6 Apr 2023 14:09:15 -0300 Subject: [PATCH 2/3] formatting --- src/backend/langflow/api/validate.py | 1 - tests/test_chains_template.py | 11 +++++------ 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/src/backend/langflow/api/validate.py b/src/backend/langflow/api/validate.py index 15600f9f7..a60bcc506 100644 --- a/src/backend/langflow/api/validate.py +++ b/src/backend/langflow/api/validate.py @@ -7,7 +7,6 @@ from langflow.api.base import ( PromptValidationResponse, validate_prompt, ) -from langflow.graph.utils import extract_input_variables_from_prompt from langflow.utils.logger import logger from langflow.utils.validate import validate_code diff --git a/tests/test_chains_template.py b/tests/test_chains_template.py index 1dfbe8da5..293809245 100644 --- a/tests/test_chains_template.py +++ b/tests/test_chains_template.py @@ -1,4 +1,3 @@ -import pytest from fastapi.testclient import TestClient @@ -356,7 +355,7 @@ def test_series_character_chain(client: TestClient): "placeholder": "", "show": False, "multiline": True, - "value": "I want you to act like {character} from {series}.\nI want you to respond and answer like {character}. do not write any explanations. only answer like {character}.\nYou must know all of the knowledge of {character}.\nCurrent conversation:\n{history}\nHuman: {input}\n{character}:", + "value": "I want you to act like {character} from {series}.\nI want you to respond and answer like {character}. do not write any explanations. only answer like {character}.\nYou must know all of the knowledge of {character}.\nCurrent conversation:\n{history}\nHuman: {input}\n{character}:", # noqa: E501 "password": False, "name": "template", "type": "str", @@ -460,7 +459,7 @@ def test_mid_journey_prompt_chain(client: TestClient): "input_variables": ["history", "input"], "output_parser": None, "partial_variables": {}, - "template": "The following is a friendly conversation between a human and an AI. The AI is talkative and provides lots of specific details from its context. If the AI does not know the answer to a question, it truthfully says it does not know.\n\nCurrent conversation:\n{history}\nHuman: {input}\nAI:", + "template": "The following is a friendly conversation between a human and an AI. The AI is talkative and provides lots of specific details from its context. If the AI does not know the answer to a question, it truthfully says it does not know.\n\nCurrent conversation:\n{history}\nHuman: {input}\nAI:", # noqa: E501 "template_format": "f-string", "validate_template": True, "_type": "prompt", @@ -507,7 +506,7 @@ def test_mid_journey_prompt_chain(client: TestClient): "placeholder": "", "show": False, "multiline": True, - "value": 'I want you to act as a prompt generator for Midjourney\'s artificial intelligence program.\n Your job is to provide detailed and creative descriptions that will inspire unique and interesting images from the AI.\n Keep in mind that the AI is capable of understanding a wide range of language and can interpret abstract concepts, so feel free to be as imaginative and descriptive as possible.\n For example, you could describe a scene from a futuristic city, or a surreal landscape filled with strange creatures.\n The more detailed and imaginative your description, the more interesting the resulting image will be. Here is your first prompt:\n "A field of wildflowers stretches out as far as the eye can see, each one a different color and shape. In the distance, a massive tree towers over the landscape, its branches reaching up to the sky like tentacles."\n\n Current conversation:\n {history}\n Human: {input}\n AI:', + "value": 'I want you to act as a prompt generator for Midjourney\'s artificial intelligence program.\n Your job is to provide detailed and creative descriptions that will inspire unique and interesting images from the AI.\n Keep in mind that the AI is capable of understanding a wide range of language and can interpret abstract concepts, so feel free to be as imaginative and descriptive as possible.\n For example, you could describe a scene from a futuristic city, or a surreal landscape filled with strange creatures.\n The more detailed and imaginative your description, the more interesting the resulting image will be. Here is your first prompt:\n "A field of wildflowers stretches out as far as the eye can see, each one a different color and shape. In the distance, a massive tree towers over the landscape, its branches reaching up to the sky like tentacles."\n\n Current conversation:\n {history}\n Human: {input}\n AI:', # noqa: E501 "password": False, "name": "template", "type": "str", @@ -588,7 +587,7 @@ def test_time_travel_guide_chain(client: TestClient): "input_variables": ["history", "input"], "output_parser": None, "partial_variables": {}, - "template": "The following is a friendly conversation between a human and an AI. The AI is talkative and provides lots of specific details from its context. If the AI does not know the answer to a question, it truthfully says it does not know.\n\nCurrent conversation:\n{history}\nHuman: {input}\nAI:", + "template": "The following is a friendly conversation between a human and an AI. The AI is talkative and provides lots of specific details from its context. If the AI does not know the answer to a question, it truthfully says it does not know.\n\nCurrent conversation:\n{history}\nHuman: {input}\nAI:", # noqa: E501 "template_format": "f-string", "validate_template": True, "_type": "prompt", @@ -637,7 +636,7 @@ def test_time_travel_guide_chain(client: TestClient): "placeholder": "", "show": False, "multiline": True, - "value": "I want you to act as my time travel guide. You are helpful and creative. I will provide you with the historical period or future time I want to visit and you will suggest the best events, sights, or people to experience. Provide the suggestions and any necessary information.\n Current conversation:\n {history}\n Human: {input}\n AI:", + "value": "I want you to act as my time travel guide. You are helpful and creative. I will provide you with the historical period or future time I want to visit and you will suggest the best events, sights, or people to experience. Provide the suggestions and any necessary information.\n Current conversation:\n {history}\n Human: {input}\n AI:", # noqa: E501 "password": False, "name": "template", "type": "str", From 26524e3b6d813d5636d352e125f039d00481bae7 Mon Sep 17 00:00:00 2001 From: Gabriel Almeida Date: Thu, 6 Apr 2023 14:24:00 -0300 Subject: [PATCH 3/3] fix: password setting improvements --- .../langflow/interface/chains/custom.py | 10 ++--- src/backend/langflow/template/base.py | 7 +-- tests/test_chains_template.py | 44 +++++++++---------- 3 files changed, 31 insertions(+), 30 deletions(-) diff --git a/src/backend/langflow/interface/chains/custom.py b/src/backend/langflow/interface/chains/custom.py index 98470d54b..cb76a53c8 100644 --- a/src/backend/langflow/interface/chains/custom.py +++ b/src/backend/langflow/interface/chains/custom.py @@ -19,7 +19,7 @@ class BaseCustomChain(ConversationChain): template: Optional[str] - ai_prefix_key: Optional[str] + ai_prefix_value: Optional[str] """Field to use as the ai_prefix. It needs to be set and has to be in the template""" @root_validator(pre=False) @@ -27,13 +27,13 @@ class BaseCustomChain(ConversationChain): format_dict = {} input_variables = extract_input_variables_from_prompt(values["template"]) - if values.get("ai_prefix_key", None) is None: - values["ai_prefix_key"] = values["memory"].ai_prefix + if values.get("ai_prefix_value", None) is None: + values["ai_prefix_value"] = values["memory"].ai_prefix for key in input_variables: new_value = values.get(key, f"{{{key}}}") format_dict[key] = new_value - if key == values.get("ai_prefix_key", None): + if key == values.get("ai_prefix_value", None): values["memory"].ai_prefix = new_value values["template"] = values["template"].format(**format_dict) @@ -62,7 +62,7 @@ Current conversation: Human: {input} {character}:""" memory: BaseMemory = Field(default_factory=ConversationBufferMemory) - ai_prefix_key: Optional[str] = "character" + ai_prefix_value: Optional[str] = "character" """Default memory store.""" diff --git a/src/backend/langflow/template/base.py b/src/backend/langflow/template/base.py index 6e6a56dce..0fe665f67 100644 --- a/src/backend/langflow/template/base.py +++ b/src/backend/langflow/template/base.py @@ -179,12 +179,13 @@ class FrontendNode(BaseModel): (field.required and key not in ["input_variables"]) or key in FORCE_SHOW_FIELDS or "api" in key - or "key" in key + or ("key" in key and "input" not in key and "output" not in key) ) # Add password field - field.password = any( - text in key.lower() for text in {"password", "token", "api", "key"} + field.password = ( + any(text in key.lower() for text in {"password", "token", "api", "key"}) + and field.show ) # Add multline diff --git a/tests/test_chains_template.py b/tests/test_chains_template.py index 293809245..6b692ee7d 100644 --- a/tests/test_chains_template.py +++ b/tests/test_chains_template.py @@ -49,7 +49,7 @@ def test_conversation_chain(client: TestClient): "show": False, "multiline": False, "value": "input", - "password": True, + "password": False, "name": "input_key", "type": "str", "list": False, @@ -60,7 +60,7 @@ def test_conversation_chain(client: TestClient): "show": False, "multiline": False, "value": "response", - "password": True, + "password": False, "name": "output_key", "type": "str", "list": False, @@ -121,7 +121,7 @@ def test_llm_chain(client: TestClient): "show": False, "multiline": False, "value": "text", - "password": True, + "password": False, "name": "output_key", "type": "str", "list": False, @@ -175,7 +175,7 @@ def test_llm_checker_chain(client: TestClient): "show": False, "multiline": False, "value": "query", - "password": True, + "password": False, "name": "input_key", "type": "str", "list": False, @@ -186,7 +186,7 @@ def test_llm_checker_chain(client: TestClient): "show": False, "multiline": False, "value": "result", - "password": True, + "password": False, "name": "output_key", "type": "str", "list": False, @@ -247,7 +247,7 @@ def test_llm_math_chain(client: TestClient): "show": False, "multiline": False, "value": "question", - "password": True, + "password": False, "name": "input_key", "type": "str", "list": False, @@ -258,7 +258,7 @@ def test_llm_math_chain(client: TestClient): "show": False, "multiline": False, "value": "answer", - "password": True, + "password": False, "name": "output_key", "type": "str", "list": False, @@ -334,7 +334,7 @@ def test_series_character_chain(client: TestClient): "show": False, "multiline": False, "value": "input", - "password": True, + "password": False, "name": "input_key", "type": "str", "list": False, @@ -345,7 +345,7 @@ def test_series_character_chain(client: TestClient): "show": False, "multiline": False, "value": "response", - "password": True, + "password": False, "name": "output_key", "type": "str", "list": False, @@ -361,14 +361,14 @@ def test_series_character_chain(client: TestClient): "type": "str", "list": False, } - assert template["ai_prefix_key"] == { + assert template["ai_prefix_value"] == { "required": False, "placeholder": "", "show": False, "multiline": False, "value": "character", - "password": True, - "name": "ai_prefix_key", + "password": False, + "name": "ai_prefix_value", "type": "str", "list": False, } @@ -485,7 +485,7 @@ def test_mid_journey_prompt_chain(client: TestClient): "show": False, "multiline": False, "value": "response", - "password": True, + "password": False, "name": "output_key", "type": "str", "list": False, @@ -496,7 +496,7 @@ def test_mid_journey_prompt_chain(client: TestClient): "show": False, "multiline": False, "value": "input", - "password": True, + "password": False, "name": "input_key", "type": "str", "list": False, @@ -512,13 +512,13 @@ def test_mid_journey_prompt_chain(client: TestClient): "type": "str", "list": False, } - assert template["ai_prefix_key"] == { + assert template["ai_prefix_value"] == { "required": False, "placeholder": "", "show": False, "multiline": False, - "password": True, - "name": "ai_prefix_key", + "password": False, + "name": "ai_prefix_value", "type": "str", "list": False, } @@ -613,7 +613,7 @@ def test_time_travel_guide_chain(client: TestClient): "show": False, "multiline": False, "value": "response", - "password": True, + "password": False, "name": "output_key", "type": "str", "list": False, @@ -625,7 +625,7 @@ def test_time_travel_guide_chain(client: TestClient): "show": False, "multiline": False, "value": "input", - "password": True, + "password": False, "name": "input_key", "type": "str", "list": False, @@ -642,13 +642,13 @@ def test_time_travel_guide_chain(client: TestClient): "type": "str", "list": False, } - assert template["ai_prefix_key"] == { + assert template["ai_prefix_value"] == { "required": False, "placeholder": "", "show": False, "multiline": False, - "password": True, - "name": "ai_prefix_key", + "password": False, + "name": "ai_prefix_value", "type": "str", "list": False, }