🚀 feat(test_prompts_template.py): change type of "suffix" and "prefix" fields to "prompt" and update "format_instructions" field

The "suffix" and "prefix" fields have been changed from type "str" to "prompt" to allow for more flexibility in the input. The "format_instructions" field has been updated to be required and multiline, and to show the instructions by default. This change will make it easier for users to understand the expected input format.
This commit is contained in:
Gabriel Almeida 2023-05-29 18:57:56 -03:00
commit c05b94e4e9

View file

@ -182,7 +182,7 @@ def test_zero_shot_prompt(client: TestClient):
"value": "Answer the following questions as best you can. You have access to the following tools:", # noqa: E501
"password": False,
"name": "prefix",
"type": "str",
"type": "prompt",
"list": False,
"advanced": False,
}
@ -194,19 +194,19 @@ def test_zero_shot_prompt(client: TestClient):
"value": "Begin!\n\nQuestion: {input}\nThought:{agent_scratchpad}",
"password": False,
"name": "suffix",
"type": "str",
"type": "prompt",
"list": False,
"advanced": False,
}
assert template["format_instructions"] == {
"required": False,
"required": True,
"placeholder": "",
"show": False,
"multiline": False,
"show": True,
"multiline": True,
"value": "Use the following format:\n\nQuestion: the input question you must answer\nThought: you should always think about what to do\nAction: the action to take, should be one of [{tool_names}]\nAction Input: the input to the action\nObservation: the result of the action\n... (this Thought/Action/Action Input/Observation can repeat N times)\nThought: I now know the final answer\nFinal Answer: the final answer to the original input question", # noqa: E501
"password": False,
"name": "format_instructions",
"type": "str",
"type": "prompt",
"list": False,
"advanced": False,
}