Spaces:
Sleeping
Sleeping
Update main.py
Browse files
main.py
CHANGED
@@ -91,30 +91,7 @@ We ensure to keep you updated at each stage and incorporate your feedback to del
|
|
91 |
use this details to give answer for my questio.only give system response only(not include customer message)
|
92 |
question : """
|
93 |
|
94 |
-
import google.generativeai as genai
|
95 |
-
from langchain.llms import OpenAI
|
96 |
-
from langchain.chat_models import ChatOpenAI
|
97 |
-
from langchain.agents.agent_types import AgentType
|
98 |
-
#from langchain_experimental.agents.agent_toolkits import create_csv_agent
|
99 |
-
|
100 |
-
|
101 |
-
from llama_index.llms import OpenAI
|
102 |
-
from llama_index import VectorStoreIndex, SimpleDirectoryReader
|
103 |
-
from llama_index.llms import OpenAI
|
104 |
-
from llama_index import StorageContext, load_index_from_storage
|
105 |
-
|
106 |
-
|
107 |
-
os.environ["OPENAI_API_KEY"]
|
108 |
|
109 |
-
try:
|
110 |
-
storage_context = StorageContext.from_defaults(persist_dir="llama_index")
|
111 |
-
index = load_index_from_storage(storage_context=storage_context)
|
112 |
-
print("loaded")
|
113 |
-
except:
|
114 |
-
documents = SimpleDirectoryReader("userguid").load_data()
|
115 |
-
index = VectorStoreIndex.from_documents(documents)
|
116 |
-
index.storage_context.persist("llama_index")
|
117 |
-
print("index created")
|
118 |
|
119 |
query_engine = index.as_query_engine()
|
120 |
|
|
|
91 |
use this details to give answer for my questio.only give system response only(not include customer message)
|
92 |
question : """
|
93 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
94 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
95 |
|
96 |
query_engine = index.as_query_engine()
|
97 |
|