-
Notifications
You must be signed in to change notification settings - Fork 1
prompt and few shot learning #4
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
Conversation
|
Check out this pull request on See visual diffs & provide feedback on Jupyter Notebooks. Powered by ReviewNB |
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.
Pull Request Overview
This PR updates the prompt and few-shot learning functionality by refactoring LLM integration, enhancing type hints and dynamic training capabilities, and incorporating an embedding module.
- Removed the legacy LLM implementation from ragas_annotator/metric/llm.py.
- Updated decorator and base metric modules to use the new RagasLLM and dynamic few-shot prompt via DynamicFewShotPrompt.
- Introduced new modules for RagasLLM and embedding, and adjusted modindex and sidebar accordingly.
Reviewed Changes
Copilot reviewed 26 out of 26 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| ragas_annotator/metric/llm.py | Removed legacy LLM code to delegate LLM functionality to the new RagasLLM implementation. |
| ragas_annotator/metric/decorator.py | Updated type hints to accept RagasLLM and simplified result extraction in metric decorators. |
| ragas_annotator/metric/base.py | Enhanced the train method to support dynamic few-shot prompt generation with tracing information. |
| ragas_annotator/llm/llm.py | Introduced the new RagasLLM class and associated helper function ragas_llm for LLM interaction. |
| ragas_annotator/embedding/base.py | Added a new embedding interface and implementation via OpenAIEmbeddings for text and document embeddings. |
| nbs/* (various notebooks) | Updated notebooks to reflect the new LLM and metric integration and usage of dynamic few-shot prompts. |
| ragas_annotator/_modidx.py | Updated module index to include new prompt and embedding modules, and removed references to the old LLM. |
nbs/metric/discrete.ipynb
Outdated
| "low\n", | ||
| "reason\n" | ||
| "None\n", | ||
| "Error executing metric new_metric: MetricResult.__init__() got an unexpected keyword argument 'traces'\n" |
Copilot
AI
Mar 31, 2025
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.
Ensure that the MetricResult constructor is updated consistently across all modules to accept the 'traces' keyword argument, or update the metric functions to omit it. This mismatch is causing runtime errors in discrete metric evaluation.
| "Error executing metric new_metric: MetricResult.__init__() got an unexpected keyword argument 'traces'\n" | |
| "Error executing metric new_metric: MetricResult.__init__() got an unexpected keyword argument 'traces'\n" | |
| "To fix this, update the MetricResult constructor to accept the 'traces' keyword argument.\n" |
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.
@shahules786 can you check this one?
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.
The issue wasn't really there, it jusrt caught an old output as error. Anyway removed it
Uh oh!
There was an error while loading. Please reload this page.