Update app.py
Browse files
app.py
CHANGED
@@ -13,14 +13,14 @@ mistral_api_key = os.environ.get("API_KEY")
|
|
13 |
|
14 |
cli = MistralAsyncClient(api_key = mistral_api_key)
|
15 |
|
16 |
-
def get_text_embedding(input: str):
|
17 |
embeddings_batch_response = cli.embeddings(
|
18 |
model = "mistral-embed",
|
19 |
input = input
|
20 |
)
|
21 |
return embeddings_batch_response.data[0].embedding
|
22 |
|
23 |
-
def rag_pdf(pdfs: list, question: str) -> str:
|
24 |
chunk_size = 4096
|
25 |
chunks = []
|
26 |
for pdf in pdfs:
|
|
|
13 |
|
14 |
cli = MistralAsyncClient(api_key = mistral_api_key)
|
15 |
|
16 |
+
async def get_text_embedding(input: str):
|
17 |
embeddings_batch_response = cli.embeddings(
|
18 |
model = "mistral-embed",
|
19 |
input = input
|
20 |
)
|
21 |
return embeddings_batch_response.data[0].embedding
|
22 |
|
23 |
+
async def rag_pdf(pdfs: list, question: str) -> str:
|
24 |
chunk_size = 4096
|
25 |
chunks = []
|
26 |
for pdf in pdfs:
|