-
Notifications
You must be signed in to change notification settings - Fork 1
Add faq consistency check #209
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
Open
cremertim
wants to merge
14
commits into
main
Choose a base branch
from
feature/faq/add-rewrite-consistency
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 5 commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
a3c21d2
First draft of inconsistency pipeline
cremertim 657fd96
Refactored to seperate inconsistencies
cremertim df8387c
Added newlines
cremertim fcf8a5a
Finished draft of implementation for FAQ inconsistencies
cremertim 3c5617e
Fixed callback url
cremertim 8be2f5c
black
cremertim 74b5254
Removed whitespaces
cremertim 7ec5dff
Removed whitespaces
cremertim a42bcb7
Removed whitespaces
cremertim de0e94c
Run black
cremertim 9262d2b
Language
cremertim 0bf244f
Test with inconsistencies
cremertim 60463af
Test repr
cremertim 4b87ff1
Test repr
cremertim 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 hidden or 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 hidden or 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 |
|---|---|---|
| @@ -1,5 +1,11 @@ | ||
| from typing import List | ||
|
|
||
| from app.domain.status.status_update_dto import StatusUpdateDTO | ||
|
|
||
|
|
||
| class RewritingStatusUpdateDTO(StatusUpdateDTO): | ||
| result: str = "" | ||
| suggestions: List[str] = [] | ||
| inconsistencies: List[str] = [] | ||
| improvement: str= "" | ||
|
|
This file contains hidden or 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,46 @@ | ||
| faq_consistency_prompt = """ | ||
| You are an AI assistant responsible for verifying the consistency of information. | ||
| ### Task: | ||
| You have been provided with a list of FAQs and a final result. Your task is to determine whether the | ||
| final result is consistent with the given FAQs. Please compare each FAQ with the final result separately. | ||
|
|
||
|
|
||
|
|
||
| ### Given FAQs: | ||
| {faqs} | ||
|
|
||
| ### Final Result: | ||
| {final_result} | ||
|
|
||
| ### Output: | ||
| Generate the following response dictionary: | ||
| "type": "consistent" or "inconsistent" | ||
|
|
||
| The following four entries to the dictionary are optional and can only be set if inconsistencies are detected: | ||
| "faqs": This entry should be a list of Strings, each string represents an FAQ. | ||
| -Make sure each faq is separated by comma. | ||
| -Also end each faq with a newline character. | ||
| -The fields are exactly named faq_id, faq_question_title and faq_question_answer | ||
| and reside within properties dict of each list entry. | ||
| -Make sure to only include inconsistent faqs | ||
| -Do not include any additional FAQs that are consistent with the final_result. | ||
|
|
||
| "message": "The provided text was rephrased, however it contains inconsistent information with existing FAQs." | ||
| -Localize the message to the language of the ###Final Result. | ||
| -Make sure to always insert two new lines after the last character of this sentences. | ||
| The affected FAQs can only contain the faq_id, faq_question_title, and faq_question_answer of inconsistent FAQs. | ||
| Make sure to not include any additional FAQs, that are consistent with the final_result. | ||
| Insert the faq_id, faq_question_title, and faq_question_answer of the inconsistent FAQ in the placeholder. | ||
|
|
||
| -"suggestion": This entry is a list of strings, each string represents a suggestion to improve the final result.\n | ||
| - Each suggestion should focus on a different inconsistency. | ||
| - Each suggestions highlights what is the inconsistency and how it can be improved. | ||
| - Do not mention the term final result, call it provided text | ||
| - Please ensure that at no time, you have a different amount of suggestions than inconsistencies.\n | ||
| Both should have the same amount of entries. | ||
|
|
||
| -"improved version": This entry should be a string that represents the improved version of the final result. | ||
|
|
||
|
|
||
| Do NOT provide any explanations or additional text. | ||
| """ |
This file was deleted.
Oops, something went wrong.
This file contains hidden or 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 hidden or 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 hidden or 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
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.
Uh oh!
There was an error while loading. Please reload this page.