Update app.py
Browse files
app.py
CHANGED
|
@@ -30,7 +30,16 @@ class TOSContent(TypedDict, total=False):
|
|
| 30 |
|
| 31 |
@tool
|
| 32 |
def search_terms_of_service(company_name: str) -> Union[TOSResult, Dict[str, str]]:
|
| 33 |
-
"""
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 34 |
try:
|
| 35 |
api_base = "https://05bf-176-76-227-247.ngrok-free.app"
|
| 36 |
url = f"{api_base}/company/{company_name}"
|
|
@@ -73,8 +82,16 @@ def search_terms_of_service(company_name: str) -> Union[TOSResult, Dict[str, str
|
|
| 73 |
@tool
|
| 74 |
def extract_tos_content(company_name: str) -> Union[TOSContent, Dict[str, str]]:
|
| 75 |
"""
|
| 76 |
-
Fetch and extract Terms of Service content for a
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 77 |
"""
|
|
|
|
|
|
|
| 78 |
tos_info = search_terms_of_service(company_name)
|
| 79 |
|
| 80 |
if "error" in tos_info:
|
|
|
|
| 30 |
|
| 31 |
@tool
|
| 32 |
def search_terms_of_service(company_name: str) -> Union[TOSResult, Dict[str, str]]:
|
| 33 |
+
"""
|
| 34 |
+
Search for a company's Terms of Service link.
|
| 35 |
+
|
| 36 |
+
Args:
|
| 37 |
+
company_name (str): The name of the organization or company to search for.
|
| 38 |
+
|
| 39 |
+
Returns:
|
| 40 |
+
Union[TOSResult, Dict[str, str]]: A dictionary containing the TOS links or an error message.
|
| 41 |
+
"""
|
| 42 |
+
|
| 43 |
try:
|
| 44 |
api_base = "https://05bf-176-76-227-247.ngrok-free.app"
|
| 45 |
url = f"{api_base}/company/{company_name}"
|
|
|
|
| 82 |
@tool
|
| 83 |
def extract_tos_content(company_name: str) -> Union[TOSContent, Dict[str, str]]:
|
| 84 |
"""
|
| 85 |
+
Fetch and extract the Terms of Service content for a company.
|
| 86 |
+
|
| 87 |
+
Args:
|
| 88 |
+
company_name (str): The name of the organization or company to search for.
|
| 89 |
+
|
| 90 |
+
Returns:
|
| 91 |
+
Union[TOSContent, Dict[str, str]]: Extracted content and metadata or an error message.
|
| 92 |
"""
|
| 93 |
+
|
| 94 |
+
|
| 95 |
tos_info = search_terms_of_service(company_name)
|
| 96 |
|
| 97 |
if "error" in tos_info:
|