-
Notifications
You must be signed in to change notification settings - Fork 4.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix ask prompts to allow prompt override/injection #2277
Merged
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
6fac970
Configure Azure Developer Pipeline
pamelafox adf0353
Merge branch 'main' of https://github.com/pamelafox/azure-search-open…
pamelafox 402e818
Merge branch 'main' of https://github.com/pamelafox/azure-search-open…
pamelafox 1e40de2
Add prompt override/inject to Ask tab, add to tests
pamelafox File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I also added "system:" to each Prompty file. That's not strictly required for the Prompty python package, but Azure AI Foundry expects it when you import a Prompty file into the Chat playground.