Spaces:
Sleeping
Sleeping
Hasnan Ramadhan
commited on
Commit
·
3296119
1
Parent(s):
c7b8084
fixing Class Initiation
Browse files
app.py
CHANGED
|
@@ -14,6 +14,13 @@ import re
|
|
| 14 |
|
| 15 |
load_dotenv()
|
| 16 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 17 |
def get_llm_response(prompt):
|
| 18 |
url = "http://192.168.181.215:8081/llms"
|
| 19 |
headers = {"Content-Type": "application/json"}
|
|
@@ -149,13 +156,6 @@ Response:"""
|
|
| 149 |
state['summaries'] = [llm_response['response']]
|
| 150 |
return state
|
| 151 |
|
| 152 |
-
class DocumentState(TypedDict):
|
| 153 |
-
documents: list[dict]
|
| 154 |
-
summaries: list[str]
|
| 155 |
-
search_results: list[dict]
|
| 156 |
-
search_query: str
|
| 157 |
-
needs_search: bool
|
| 158 |
-
|
| 159 |
def document_extractor_agent(state: DocumentState, pdf_path: str) -> DocumentState:
|
| 160 |
"""Extracts documents from a PDF file."""
|
| 161 |
try:
|
|
|
|
| 14 |
|
| 15 |
load_dotenv()
|
| 16 |
|
| 17 |
+
class DocumentState(TypedDict):
|
| 18 |
+
documents: list[dict]
|
| 19 |
+
summaries: list[str]
|
| 20 |
+
search_results: list[dict]
|
| 21 |
+
search_query: str
|
| 22 |
+
needs_search: bool
|
| 23 |
+
|
| 24 |
def get_llm_response(prompt):
|
| 25 |
url = "http://192.168.181.215:8081/llms"
|
| 26 |
headers = {"Content-Type": "application/json"}
|
|
|
|
| 156 |
state['summaries'] = [llm_response['response']]
|
| 157 |
return state
|
| 158 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 159 |
def document_extractor_agent(state: DocumentState, pdf_path: str) -> DocumentState:
|
| 160 |
"""Extracts documents from a PDF file."""
|
| 161 |
try:
|