-
Notifications
You must be signed in to change notification settings - Fork 5
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
feat(document-search): LLM-based query rephraser #115
feat(document-search): LLM-based query rephraser #115
Conversation
Code Coverage Summary
Diff against main
Results for commit: fd4a48d Minimum allowed coverage is ♻️ This comment has been updated with latest results |
Trivy scanning results. .venv/lib/python3.10/site-packages/PyJWT-2.9.0.dist-info/METADATA (secrets)Total: 1 (MEDIUM: 1, HIGH: 0, CRITICAL: 0) MEDIUM: JWT (jwt-token) .venv/lib/python3.10/site-packages/litellm/llms/huggingface_llms_metadata/hf_text_generation_models.txt (secrets)Total: 1 (MEDIUM: 0, HIGH: 0, CRITICAL: 1) CRITICAL: HuggingFace (hugging-face-access-token) .venv/lib/python3.10/site-packages/litellm/proxy/_types.py (secrets)Total: 1 (MEDIUM: 1, HIGH: 0, CRITICAL: 0) MEDIUM: Slack (slack-web-hook) |
""" | ||
Rephrase a query. | ||
|
||
Args: | ||
query: The query to rephrase. | ||
options: OptionaL options to fine-tune the rephraser behavior. |
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.
options: OptionaL options to fine-tune the rephraser behavior. | |
options: Optional configuration of the the rephraser behavior. |
(it's very nit-picky but fixes the "L" in "OptionaL", the awkward sounding "Optional options", and gets rid of the word "fine-tuning" which got me confused at first since usually it has a different meaning when used with LLMs)
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.
thank you, fixed
""" | ||
Mock implementation which outputs the same query as in input. | ||
|
||
Args: | ||
query: The query to rephrase. | ||
options: OptionaL options to fine-tune the rephraser behavior. |
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.
options: OptionaL options to fine-tune the rephraser behavior. | |
options: Optional configuration of the the rephraser behavior. |
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.
fixed :)
If not provided, the default `QueryRephraserPrompt` is used. | ||
""" | ||
|
||
self._prompt = prompt or QueryRephraserPrompt |
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.
Wouldn't this mean that _prompt
sometimes is an instance of QueryRephraserPrompt
and sometimes it's the class itself? I also don't see self._prompt
used anywhere. In the rephrase
method QueryRephraserPrompt
is used directly.
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.
Right, I cleaned it up now and prompt is no longer an attribute
No description provided.