Skip to content

Commit 8294553

Browse files
updated response structure for content fetch
1 parent e602e66 commit 8294553

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

src/app.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1351,9 +1351,10 @@ async def fetch_azure_search_content():
13511351
print("Fetching content from Azure Search")
13521352
request_json = await request.get_json()
13531353
url = request_json.get("url")
1354+
title = request_json.get("title")
13541355

1355-
if not url:
1356-
return jsonify({"error": "URL is required"}), 400
1356+
if not url or not title:
1357+
return jsonify({"error": "URL and title are required"}), 400
13571358

13581359
# Get Azure AD token
13591360
credential = DefaultAzureCredentialSync()
@@ -1384,7 +1385,10 @@ def fetch_content(fetch_url):
13841385
result = await asyncio.to_thread(fetch_content, url)
13851386

13861387
if result["success"]:
1387-
return jsonify({"content": result["content"]}), 200
1388+
return jsonify({
1389+
"content": result["content"],
1390+
"title": title
1391+
}), 200
13881392
else:
13891393
return jsonify({"error": result["error"]}), 500
13901394

0 commit comments

Comments
 (0)