merging branch release into dev
This commit is contained in:
parent
683c69340b
commit
168a1b9e0f
75 changed files with 2956 additions and 848 deletions
|
|
@ -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,85 +90,7 @@ def test_prompt_template(client: TestClient):
|
|||
"type": "bool",
|
||||
"list": False,
|
||||
"advanced": False,
|
||||
}
|
||||
|
||||
|
||||
def test_few_shot_prompt_template(client: TestClient):
|
||||
response = client.get("api/v1/all")
|
||||
assert response.status_code == 200
|
||||
json_response = response.json()
|
||||
prompts = json_response["prompts"]
|
||||
|
||||
prompt = prompts["FewShotPromptTemplate"]
|
||||
template = prompt["template"]
|
||||
# Test other fields in the template similar to PromptTemplate
|
||||
assert template["examples"] == {
|
||||
"required": False,
|
||||
"placeholder": "",
|
||||
"show": True,
|
||||
"multiline": True,
|
||||
"password": False,
|
||||
"name": "examples",
|
||||
"type": "prompt",
|
||||
"list": True,
|
||||
"advanced": False,
|
||||
}
|
||||
assert template["example_selector"] == {
|
||||
"required": False,
|
||||
"placeholder": "",
|
||||
"show": False,
|
||||
"multiline": False,
|
||||
"password": False,
|
||||
"name": "example_selector",
|
||||
"type": "BaseExampleSelector",
|
||||
"list": False,
|
||||
"advanced": False,
|
||||
}
|
||||
assert template["example_prompt"] == {
|
||||
"required": True,
|
||||
"placeholder": "",
|
||||
"show": True,
|
||||
"multiline": False,
|
||||
"password": False,
|
||||
"name": "example_prompt",
|
||||
"type": "PromptTemplate",
|
||||
"list": False,
|
||||
"advanced": False,
|
||||
}
|
||||
assert template["suffix"] == {
|
||||
"required": True,
|
||||
"placeholder": "",
|
||||
"show": True,
|
||||
"multiline": True,
|
||||
"password": False,
|
||||
"name": "suffix",
|
||||
"type": "prompt",
|
||||
"list": False,
|
||||
"advanced": False,
|
||||
}
|
||||
assert template["example_separator"] == {
|
||||
"required": False,
|
||||
"placeholder": "",
|
||||
"show": False,
|
||||
"multiline": False,
|
||||
"value": "\n\n",
|
||||
"password": False,
|
||||
"name": "example_separator",
|
||||
"type": "str",
|
||||
"list": False,
|
||||
"advanced": False,
|
||||
}
|
||||
assert template["prefix"] == {
|
||||
"required": False,
|
||||
"placeholder": "",
|
||||
"show": True,
|
||||
"multiline": True,
|
||||
"value": "",
|
||||
"password": False,
|
||||
"name": "prefix",
|
||||
"type": "prompt",
|
||||
"list": False,
|
||||
"advanced": False,
|
||||
"info": "",
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -185,6 +112,7 @@ def test_zero_shot_prompt(client: TestClient):
|
|||
"type": "prompt",
|
||||
"list": False,
|
||||
"advanced": False,
|
||||
"info": "",
|
||||
}
|
||||
assert template["suffix"] == {
|
||||
"required": True,
|
||||
|
|
@ -197,6 +125,7 @@ def test_zero_shot_prompt(client: TestClient):
|
|||
"type": "prompt",
|
||||
"list": False,
|
||||
"advanced": False,
|
||||
"info": "",
|
||||
}
|
||||
assert template["format_instructions"] == {
|
||||
"required": True,
|
||||
|
|
@ -209,4 +138,5 @@ def test_zero_shot_prompt(client: TestClient):
|
|||
"type": "prompt",
|
||||
"list": False,
|
||||
"advanced": False,
|
||||
"info": "",
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue