Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -2,13 +2,17 @@ from langchain_core.prompts import ChatPromptTemplate, MessagesPlaceholder
|
|
2 |
from langchain_core.messages import HumanMessage
|
3 |
from langchain_core.messages import AIMessage
|
4 |
from langchain.memory import ChatMessageHistory
|
5 |
-
from langchain_openai import AzureChatOpenAI
|
6 |
from pypdf import PdfReader
|
7 |
import os
|
8 |
import gradio as gr
|
|
|
9 |
|
10 |
-
|
11 |
-
|
|
|
|
|
|
|
|
|
12 |
def extract_text( pdf_path):
|
13 |
# creating a pdf reader object
|
14 |
reader = PdfReader(pdf_path)
|
|
|
2 |
from langchain_core.messages import HumanMessage
|
3 |
from langchain_core.messages import AIMessage
|
4 |
from langchain.memory import ChatMessageHistory
|
|
|
5 |
from pypdf import PdfReader
|
6 |
import os
|
7 |
import gradio as gr
|
8 |
+
from openai import AzureOpenAI
|
9 |
|
10 |
+
client = AzureOpenAI(
|
11 |
+
api_key=os.getenv("API"),
|
12 |
+
api_version="2023-07-01-preview",
|
13 |
+
azure_endpoint=os.getenv("URL"),
|
14 |
+
azure_deployment = "gpt-4o"
|
15 |
+
)
|
16 |
def extract_text( pdf_path):
|
17 |
# creating a pdf reader object
|
18 |
reader = PdfReader(pdf_path)
|