Skip to content
This repository has been archived by the owner on Mar 1, 2024. It is now read-only.

Commit

Permalink
Update prompts
Browse files Browse the repository at this point in the history
  • Loading branch information
ravi03071991 committed Feb 12, 2024
1 parent 335a7ac commit 7e8ef81
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 34 deletions.
34 changes: 34 additions & 0 deletions llama_hub/llama_packs/corrective_rag/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,40 @@
from llama_index.schema import Document, NodeWithScore
from llama_index.query_pipeline.query import QueryPipeline
from llama_hub.tools.tavily_research.base import TavilyToolSpec
from llama_index.prompts import PromptTemplate

DEFAULT_RELEVANCY_PROMPT_TEMPLATE = PromptTemplate(
template="""As a grader, your task is to evaluate the relevance of a document retrieved in response to a user's question.
Retrieved Document:
-------------------
{context_str}
User Question:
--------------
{query_str}
Evaluation Criteria:
- Consider whether the document contains keywords or topics related to the user's question.
- The evaluation should not be overly stringent; the primary objective is to identify and filter out clearly irrelevant retrievals.
Decision:
- Assign a binary score to indicate the document's relevance.
- Use 'yes' if the document is relevant to the question, or 'no' if it is not.
Please provide your binary score ('yes' or 'no') below to indicate the document's relevance to the user question."""
)

DEFAULT_TRANSFORM_QUERY_TEMPLATE = PromptTemplate(
template="""Your task is to refine a query to ensure it is highly effective for retrieving relevant search results. \n
Analyze the given input to grasp the core semantic intent or meaning. \n
Original Query:
\n ------- \n
{query_str}
\n ------- \n
Your goal is to rephrase or enhance this query to improve its search performance. Ensure the revised query is concise and directly aligned with the intended search objective. \n
Respond with the optimized query only:"""
)


class CorrectiveRAGPack(BaseLlamaPack):
Expand Down
34 changes: 0 additions & 34 deletions llama_hub/llama_packs/corrective_rag/prompts.py

This file was deleted.

0 comments on commit 7e8ef81

Please sign in to comment.