Corrective rag
CorrectiveRAGPack #
Bases: BaseLlamaPack
Source code in llama-index-packs/llama-index-packs-corrective-rag/llama_index/packs/corrective_rag/base.py
47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 |
|
get_modules #
get_modules() -> Dict[str, Any]
Get modules.
Source code in llama-index-packs/llama-index-packs-corrective-rag/llama_index/packs/corrective_rag/base.py
62 63 64 |
|
retrieve_nodes #
retrieve_nodes(query_str: str, **kwargs: Any) -> List[NodeWithScore]
Retrieve the relevant nodes for the query.
Source code in llama-index-packs/llama-index-packs-corrective-rag/llama_index/packs/corrective_rag/base.py
66 67 68 69 |
|
evaluate_relevancy #
evaluate_relevancy(retrieved_nodes: List[Document], query_str: str) -> List[str]
Evaluate relevancy of retrieved documents with the query.
Source code in llama-index-packs/llama-index-packs-corrective-rag/llama_index/packs/corrective_rag/base.py
71 72 73 74 75 76 77 78 79 80 81 |
|
extract_relevant_texts #
extract_relevant_texts(retrieved_nodes: List[NodeWithScore], relevancy_results: List[str]) -> str
Extract relevant texts from retrieved documents.
Source code in llama-index-packs/llama-index-packs-corrective-rag/llama_index/packs/corrective_rag/base.py
83 84 85 86 87 88 89 90 91 92 |
|
search_with_transformed_query #
search_with_transformed_query(query_str: str) -> str
Search the transformed query with Tavily API.
Source code in llama-index-packs/llama-index-packs-corrective-rag/llama_index/packs/corrective_rag/base.py
94 95 96 97 |
|
get_result #
get_result(relevant_text: str, search_text: str, query_str: str) -> Any
Get result with relevant text.
Source code in llama-index-packs/llama-index-packs-corrective-rag/llama_index/packs/corrective_rag/base.py
99 100 101 102 103 104 |
|
run #
run(query_str: str, **kwargs: Any) -> Any
Run the pipeline.
Source code in llama-index-packs/llama-index-packs-corrective-rag/llama_index/packs/corrective_rag/base.py
106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 |
|