Skip to content

Conversation

@shahules786
Copy link
Member

@shahules786 shahules786 commented Mar 27, 2025

my_metric.train(project,experiment_names=['my-experiment-12'],embedding_model=embedding,model=Experiment,method={})

@review-notebook-app
Copy link

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

@shahules786 shahules786 marked this pull request as ready for review March 28, 2025 02:03
@shahules786 shahules786 requested a review from jjmachan March 28, 2025 02:05
@shahules786 shahules786 requested review from Copilot and jjmachan March 31, 2025 17:50
Copy link

Copilot AI left a 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.

"low\n",
"reason\n"
"None\n",
"Error executing metric new_metric: MetricResult.__init__() got an unexpected keyword argument 'traces'\n"
Copy link

Copilot AI Mar 31, 2025

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.

Suggested change
"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"

Copilot uses AI. Check for mistakes.
Copy link
Member

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?

Copy link
Member Author

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

@shahules786 shahules786 merged commit 3ba3f46 into main Apr 3, 2025
2 checks passed
@jjmachan jjmachan deleted the prompt branch April 17, 2025 19:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants