-
Notifications
You must be signed in to change notification settings - Fork 4.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix ask prompts to allow prompt override/injection (#2277)
* Configure Azure Developer Pipeline * Add prompt override/inject to Ask tab, add to tests
- Loading branch information
Showing
13 changed files
with
379 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
78 changes: 78 additions & 0 deletions
78
tests/snapshots/test_app/test_ask_prompt_template/client0/result.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
{ | ||
"context": { | ||
"data_points": { | ||
"text": [ | ||
"Benefit_Options-2.pdf: There is a whistleblower policy." | ||
] | ||
}, | ||
"thoughts": [ | ||
{ | ||
"description": "What is the capital of France?", | ||
"props": { | ||
"filter": null, | ||
"top": 3, | ||
"use_semantic_captions": false, | ||
"use_semantic_ranker": false, | ||
"use_text_search": true, | ||
"use_vector_search": false | ||
}, | ||
"title": "Search using user query" | ||
}, | ||
{ | ||
"description": [ | ||
{ | ||
"captions": [ | ||
{ | ||
"additional_properties": {}, | ||
"highlights": [], | ||
"text": "Caption: A whistleblower policy." | ||
} | ||
], | ||
"category": null, | ||
"content": "There is a whistleblower policy.", | ||
"embedding": null, | ||
"groups": null, | ||
"id": "file-Benefit_Options_pdf-42656E656669745F4F7074696F6E732E706466-page-2", | ||
"imageEmbedding": null, | ||
"oids": null, | ||
"reranker_score": 3.4577205181121826, | ||
"score": 0.03279569745063782, | ||
"sourcefile": "Benefit_Options.pdf", | ||
"sourcepage": "Benefit_Options-2.pdf" | ||
} | ||
], | ||
"props": null, | ||
"title": "Search results" | ||
}, | ||
{ | ||
"description": [ | ||
{ | ||
"content": "You are a cat.", | ||
"role": "system" | ||
}, | ||
{ | ||
"content": "What is the deductible for the employee plan for a visit to Overlake in Bellevue?\n\nSources:\ninfo1.txt: deductibles depend on whether you are in-network or out-of-network. In-network deductibles are $500 for employee and $1000 for family. Out-of-network deductibles are $1000 for employee and $2000 for family.\ninfo2.pdf: Overlake is in-network for the employee plan.\ninfo3.pdf: Overlake is the name of the area that includes a park and ride near Bellevue.\ninfo4.pdf: In-network institutions include Overlake, Swedish and others in the region.", | ||
"role": "user" | ||
}, | ||
{ | ||
"content": "In-network deductibles are $500 for employee and $1000 for family [info1.txt] and Overlake is in-network for the employee plan [info2.pdf][info4.pdf].", | ||
"role": "assistant" | ||
}, | ||
{ | ||
"content": "What is the capital of France?\nSources:\n\nBenefit_Options-2.pdf: There is a whistleblower policy.", | ||
"role": "user" | ||
} | ||
], | ||
"props": { | ||
"model": "gpt-35-turbo" | ||
}, | ||
"title": "Prompt to generate answer" | ||
} | ||
] | ||
}, | ||
"message": { | ||
"content": "The capital of France is Paris. [Benefit_Options-2.pdf].", | ||
"role": "assistant" | ||
}, | ||
"session_state": null | ||
} |
79 changes: 79 additions & 0 deletions
79
tests/snapshots/test_app/test_ask_prompt_template/client1/result.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
{ | ||
"context": { | ||
"data_points": { | ||
"text": [ | ||
"Benefit_Options-2.pdf: There is a whistleblower policy." | ||
] | ||
}, | ||
"thoughts": [ | ||
{ | ||
"description": "What is the capital of France?", | ||
"props": { | ||
"filter": null, | ||
"top": 3, | ||
"use_semantic_captions": false, | ||
"use_semantic_ranker": false, | ||
"use_text_search": true, | ||
"use_vector_search": false | ||
}, | ||
"title": "Search using user query" | ||
}, | ||
{ | ||
"description": [ | ||
{ | ||
"captions": [ | ||
{ | ||
"additional_properties": {}, | ||
"highlights": [], | ||
"text": "Caption: A whistleblower policy." | ||
} | ||
], | ||
"category": null, | ||
"content": "There is a whistleblower policy.", | ||
"embedding": null, | ||
"groups": null, | ||
"id": "file-Benefit_Options_pdf-42656E656669745F4F7074696F6E732E706466-page-2", | ||
"imageEmbedding": null, | ||
"oids": null, | ||
"reranker_score": 3.4577205181121826, | ||
"score": 0.03279569745063782, | ||
"sourcefile": "Benefit_Options.pdf", | ||
"sourcepage": "Benefit_Options-2.pdf" | ||
} | ||
], | ||
"props": null, | ||
"title": "Search results" | ||
}, | ||
{ | ||
"description": [ | ||
{ | ||
"content": "You are a cat.", | ||
"role": "system" | ||
}, | ||
{ | ||
"content": "What is the deductible for the employee plan for a visit to Overlake in Bellevue?\n\nSources:\ninfo1.txt: deductibles depend on whether you are in-network or out-of-network. In-network deductibles are $500 for employee and $1000 for family. Out-of-network deductibles are $1000 for employee and $2000 for family.\ninfo2.pdf: Overlake is in-network for the employee plan.\ninfo3.pdf: Overlake is the name of the area that includes a park and ride near Bellevue.\ninfo4.pdf: In-network institutions include Overlake, Swedish and others in the region.", | ||
"role": "user" | ||
}, | ||
{ | ||
"content": "In-network deductibles are $500 for employee and $1000 for family [info1.txt] and Overlake is in-network for the employee plan [info2.pdf][info4.pdf].", | ||
"role": "assistant" | ||
}, | ||
{ | ||
"content": "What is the capital of France?\nSources:\n\nBenefit_Options-2.pdf: There is a whistleblower policy.", | ||
"role": "user" | ||
} | ||
], | ||
"props": { | ||
"deployment": "test-chatgpt", | ||
"model": "gpt-35-turbo" | ||
}, | ||
"title": "Prompt to generate answer" | ||
} | ||
] | ||
}, | ||
"message": { | ||
"content": "The capital of France is Paris. [Benefit_Options-2.pdf].", | ||
"role": "assistant" | ||
}, | ||
"session_state": null | ||
} |
Oops, something went wrong.