Skip to content
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

[MS-493] RAG #101

Open
wants to merge 10 commits into
base: dev_main
Choose a base branch
from
Open

[MS-493] RAG #101

wants to merge 10 commits into from

Conversation

imda-lionelteo
Copy link
Collaborator

@imda-lionelteo imda-lionelteo commented Sep 13, 2024

Description

As a dev, I want to test my RAG application on its capability so that I can evaluate how well it performs.

Acceptance Criteria
Implementation of the following metrics from RAGAS:
Faithfulness
Answer Correctness
Answer Relevance
Context Precision
Context Recall

https://docs.ragas.io/en/stable/getstarted/install.html
Establish a connection to an RAG to retrieve the "context" input

Motivation and Context

As a dev, I want to test my RAG application on its capability so that I can evaluate how well it performs.

Acceptance Criteria
Implementation of the following metrics from RAGAS:
Faithfulness
Answer Correctness
Answer Relevance
Context Precision
Context Recall

https://docs.ragas.io/en/stable/getstarted/install.html
Establish a connection to an RAG to retrieve the "context" input

Type of Change

  • feat: A new feature

How to Test

There are huge changes in this ticket. Please test it properly and thoroughly.

There is a zip files that contains scripts and so on.

  1. setup_api_tera.sh
  2. tera-connector.py (to be placed in connectors)
  3. tera-connector.json (to be placed in connectors-endpoints)
  4. test-rag-cookbook.json (to be placed in cookbooks)
  5. test-rag-recipe.json (to be placed in recipes)
  6. test-rag.json (to be placed in datasets)

Steps:

  1. Update your azure-langchain-openai-chatopenai-gpt4o.json and azure-langchain-openai-embedding-ada-2 with our azure openai key and uri.

  2. Check if you need to modify setup_api_tera.sh to run forked tera-sample-files or tera-sample-files. You should be using forked tera-sample-files.

  3. Proceed to setup TERA.
    3.1 Create a new terminal
    3.2 Create venv by using python -m venv venv
    3.3 Activate the virtual environment
    3.4 Run the script using ./setup_api_tera.sh (SEED Must be off.)
    3.5 It will clone and install requirements and run docker and start the fastapi service.

You can test using POSTMAN on the endpoints (localhost:8000/get_agent_context and localhost:8000/get_agent_response).
So if that works, proceed to the next step.

  1. Clone both moonshot and moonshot-data with https://imda-dsl.atlassian.net/browse/MS-493 branch, install their requirements.
  2. Place the test files in their respective places.
  3. Run the command in interactive mode.
    run_recipe "myrag" "['test-rag-recipe']" "['tera-connector']" -n 1 -r 1 -s "You are an intelligent AI"

Checklist

Please check all the boxes that apply to this pull request using "x":

  • I have tested the changes locally and verified that they work as expected.
  • I have added or updated the necessary documentation (README, API docs, etc.).
  • I have added appropriate unit tests or functional tests for the changes made.
  • I have followed the project's coding conventions and style guidelines.
  • I have rebased my branch onto the latest commit of the main branch.
  • I have squashed or reorganized my commits into logical units.
  • I have added any necessary dependencies or packages to the project's build configuration.
  • I have performed a self-review of my own code.
  • I have read, understood and agree to the Developer Certificate of Origin below, which this project utilises.

Screenshots (if applicable)

[If the changes involve visual modifications, include screenshots or GIFs that demonstrate the changes.]

Additional Notes

[Add any additional information or context that might be relevant to reviewers.]

Developer Certificate of Origin
Developer Certificate of Origin
Version 1.1

Copyright (C) 2004, 2006 The Linux Foundation and its contributors.

Everyone is permitted to copy and distribute verbatim copies of this
license document, but changing it is not allowed.


Developer's Certificate of Origin 1.1

By making a contribution to this project, I certify that:

(a) The contribution was created in whole or in part by me and I
   have the right to submit it under the open source license
   indicated in the file; or

(b) The contribution is based upon previous work that, to the best
   of my knowledge, is covered under an appropriate open source
   license and I have the right under that license to submit that
   work with modifications, whether created in whole or in part
   by me, under the same open source license (unless I am
   permitted to submit under a different license), as indicated
   in the file; or

(c) The contribution was provided directly to me by some other
   person who certified (a), (b) or (c) and I have not modified
   it.

(d) I understand and agree that this project and the contribution
   are public and that a record of the contribution (including all
   personal information I submit with it, including my sign-off) is
   maintained indefinitely and may be redistributed consistent with
   this project or the open source license(s) involved.

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.

2 participants