Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -62,13 +62,15 @@ INDEX_NAME = "agenticrag"
|
|
| 62 |
if not PINECONE_API_KEY:
|
| 63 |
raise ValueError("Pinecone API Key is missing. Please set it in environment variables.")
|
| 64 |
|
| 65 |
-
|
| 66 |
embeddings = HuggingFaceEmbeddings(model_name="sentence-transformers/all-MiniLM-L6-v2")
|
| 67 |
|
| 68 |
-
#
|
| 69 |
-
pc = PineconeClient(api_key=PINECONE_API_KEY)
|
| 70 |
-
|
| 71 |
-
|
|
|
|
|
|
|
| 72 |
# Load LLM & Memory
|
| 73 |
llm = ChatAnthropic(
|
| 74 |
model="claude-2",
|
|
|
|
| 62 |
if not PINECONE_API_KEY:
|
| 63 |
raise ValueError("Pinecone API Key is missing. Please set it in environment variables.")
|
| 64 |
|
| 65 |
+
Initialize Hugging Face Embeddings
|
| 66 |
embeddings = HuggingFaceEmbeddings(model_name="sentence-transformers/all-MiniLM-L6-v2")
|
| 67 |
|
| 68 |
+
# Create Pinecone client
|
| 69 |
+
pc = PineconeClient(api_key=PINECONE_API_KEY, environment=PINECONE_ENV)
|
| 70 |
+
|
| 71 |
+
# Initialize Pinecone vector store with LangChain
|
| 72 |
+
vector_store = Pinecone(client=pc, index_name=INDEX_NAME, embedding_function=embeddings.embed_query)
|
| 73 |
+
|
| 74 |
# Load LLM & Memory
|
| 75 |
llm = ChatAnthropic(
|
| 76 |
model="claude-2",
|