Update app.py
Browse files
app.py
CHANGED
@@ -4,7 +4,7 @@ import os, time
|
|
4 |
from dotenv import load_dotenv, find_dotenv
|
5 |
|
6 |
from rag_langchain import llm_chain, rag_chain, rag_ingestion_langchain
|
7 |
-
from rag_llamaindex import LlamaIndexRAG
|
8 |
from trace import trace_wandb
|
9 |
|
10 |
_ = load_dotenv(find_dotenv())
|
@@ -35,7 +35,8 @@ def invoke(openai_api_key, prompt, rag_option):
|
|
35 |
if (rag_option == RAG_LANGCHAIN):
|
36 |
rag_ingestion_llangchain(config)
|
37 |
elif (rag_option == RAG_LLAMAINDEX):
|
38 |
-
|
|
|
39 |
|
40 |
completion = ""
|
41 |
result = ""
|
@@ -50,9 +51,8 @@ def invoke(openai_api_key, prompt, rag_option):
|
|
50 |
|
51 |
result = completion["result"]
|
52 |
elif (rag_option == RAG_LLAMAINDEX):
|
53 |
-
#result = rag_retrieval(config, prompt)
|
54 |
rag = LlamaIndexRAG()
|
55 |
-
result = rag.
|
56 |
else:
|
57 |
completion, chain, callback = llm_chain(config, prompt)
|
58 |
|
|
|
4 |
from dotenv import load_dotenv, find_dotenv
|
5 |
|
6 |
from rag_langchain import llm_chain, rag_chain, rag_ingestion_langchain
|
7 |
+
from rag_llamaindex import LlamaIndexRAG
|
8 |
from trace import trace_wandb
|
9 |
|
10 |
_ = load_dotenv(find_dotenv())
|
|
|
35 |
if (rag_option == RAG_LANGCHAIN):
|
36 |
rag_ingestion_llangchain(config)
|
37 |
elif (rag_option == RAG_LLAMAINDEX):
|
38 |
+
rag = LlamaIndexRAG()
|
39 |
+
rag.ingestion(config)
|
40 |
|
41 |
completion = ""
|
42 |
result = ""
|
|
|
51 |
|
52 |
result = completion["result"]
|
53 |
elif (rag_option == RAG_LLAMAINDEX):
|
|
|
54 |
rag = LlamaIndexRAG()
|
55 |
+
result = rag.retrieval(config, prompt)
|
56 |
else:
|
57 |
completion, chain, callback = llm_chain(config, prompt)
|
58 |
|