Update retriever.py
Browse files- retriever.py +2 -1
retriever.py
CHANGED
|
@@ -4,13 +4,14 @@ from pinecone import Pinecone
|
|
| 4 |
from langchain_openai import AzureOpenAIEmbeddings
|
| 5 |
import uuid
|
| 6 |
import pandas as pd
|
|
|
|
| 7 |
|
| 8 |
# Initialize Pinecone client
|
| 9 |
pc = Pinecone(api_key="567aca04-6fb0-40a0-ba92-a5ed30be190b")
|
| 10 |
index = pc.Index("openai-serverless")
|
| 11 |
|
| 12 |
# Azure OpenAI configuration
|
| 13 |
-
os.environ["AZURE_OPENAI_API_KEY"] =
|
| 14 |
os.environ["AZURE_OPENAI_ENDPOINT"] = "https://davidfearn-gpt4.openai.azure.com/"
|
| 15 |
os.environ["AZURE_OPENAI_DEPLOYMENT_NAME"] = "text-embedding-ada-002"
|
| 16 |
os.environ["AZURE_OPENAI_API_VERSION"] = "2024-08-01-preview"
|
|
|
|
| 4 |
from langchain_openai import AzureOpenAIEmbeddings
|
| 5 |
import uuid
|
| 6 |
import pandas as pd
|
| 7 |
+
import streamlit as st
|
| 8 |
|
| 9 |
# Initialize Pinecone client
|
| 10 |
pc = Pinecone(api_key="567aca04-6fb0-40a0-ba92-a5ed30be190b")
|
| 11 |
index = pc.Index("openai-serverless")
|
| 12 |
|
| 13 |
# Azure OpenAI configuration
|
| 14 |
+
os.environ["AZURE_OPENAI_API_KEY"] = st.secrets["API_KEY"]
|
| 15 |
os.environ["AZURE_OPENAI_ENDPOINT"] = "https://davidfearn-gpt4.openai.azure.com/"
|
| 16 |
os.environ["AZURE_OPENAI_DEPLOYMENT_NAME"] = "text-embedding-ada-002"
|
| 17 |
os.environ["AZURE_OPENAI_API_VERSION"] = "2024-08-01-preview"
|