A Python package for handling question-answering functionality with your RAG (Retrieval-Augmented Generation) capabilities.
Install the package using pip:
pip install quest_llm_judge
Here's a simple example of how to use the package:
from quest_llm_judge.handler import LlmJudge
from flask import Flask
# Initialize FastAPI app
app = Flask()
# Initialize the handler
handler = LlmJudge()
# Define your query response function
def get_query_response(query: str) -> str:
# Add your query processing logic here
# This function should return the answer as a string
return "Your processed answer here"
# Create the endpoint
handler.create_rag_response_endpoint(
app=app,
get_query_response=get_query_response
)
-
First, import the necessary components:
from quest_llm_quest.handler import LlmJudge
-
Initialize the handler instance:
handler = LlmJudge()
-
Define your query response function:
def get_query_response(query: str) -> str: # Your implementation here return answer
-
Create the endpoint using the handler:
handler.create_rag_response_endpoint( app=app, get_query_response=get_query_response )
Creates an endpoint for handling RAG-based question-answering.
Parameters:
app
: Flask application instanceget_query_response
: Function that processes the query and returns an answer
The function should have the following signature:
def get_query_response(query: str) -> str
Contributions are welcome! Please feel free to submit a Pull Request.