Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -123,6 +123,8 @@ AZURE_OPENAI_ENDPOINT = os.getenv("AZURE_OPENAI_ENDPOINT")
|
|
123 |
AZURE_EMBEDDING_DEPLOYMENT = "embedding" # Make sure it matches Azure deployment name
|
124 |
PINECONE_API_KEY = os.getenv("PINECONE_API_KEY")
|
125 |
COHERE_API_KEY = os.getenv("COHERE_API_KEY")
|
|
|
|
|
126 |
|
127 |
# === Pinecone Setup ===
|
128 |
EMBED_INDEXES = {
|
@@ -153,9 +155,9 @@ llm_client = AzureOpenAI(
|
|
153 |
# === Async Embedding Function for Ada ===
|
154 |
async def get_ada_embedding(texts):
|
155 |
client = AsyncAzureOpenAI(
|
156 |
-
api_key=
|
157 |
api_version="2023-05-15",
|
158 |
-
base_url=f"{
|
159 |
)
|
160 |
response = await client.embeddings.create(
|
161 |
input=texts,
|
|
|
123 |
AZURE_EMBEDDING_DEPLOYMENT = "embedding" # Make sure it matches Azure deployment name
|
124 |
PINECONE_API_KEY = os.getenv("PINECONE_API_KEY")
|
125 |
COHERE_API_KEY = os.getenv("COHERE_API_KEY")
|
126 |
+
EMBED_API = os.getenv("EMBED_API")
|
127 |
+
EMBED_ENDPOINT = os.getenv("EMBED_ENDPOINT")
|
128 |
|
129 |
# === Pinecone Setup ===
|
130 |
EMBED_INDEXES = {
|
|
|
155 |
# === Async Embedding Function for Ada ===
|
156 |
async def get_ada_embedding(texts):
|
157 |
client = AsyncAzureOpenAI(
|
158 |
+
api_key=EMBED_API,
|
159 |
api_version="2023-05-15",
|
160 |
+
base_url=f"{EMBED_ENDPOINT}/openai/deployments/{AZURE_EMBEDDING_DEPLOYMENT}"
|
161 |
)
|
162 |
response = await client.embeddings.create(
|
163 |
input=texts,
|