Skip to content

Commit

Permalink
Merge branch 'refs/heads/main' into eugene/tlk-2361-north-modify-prea…
Browse files Browse the repository at this point in the history
…mble-or-instructions-to-generate-valid
  • Loading branch information
EugeneLightsOn committed Dec 13, 2024
2 parents 6974443 + 839f258 commit 51412a5
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
3 changes: 2 additions & 1 deletion src/backend/tools/hybrid_search.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,8 @@ async def rerank_results(
documents=[
f"{result.get('title', '')} {result.get('text')}"
for result in results_batch
if "text" in result
if isinstance(result, dict)
and "text" in result
],
ctx=ctx,
)
Expand Down
8 changes: 4 additions & 4 deletions src/backend/tools/web_scrape.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,15 +64,15 @@ async def call(
return await self.handle_response(response, url)

except aiohttp.ClientError as e:
return {
return [{
"text": f"Client error using web scrape: {str(e)}",
"url": url,
}
}]
except Exception as e:
return {
return [{
"text": f"Request failed using web scrape: {str(e)}",
"url": url,
}
}]

async def handle_response(self, response: aiohttp.ClientResponse, url: str):
content_type = response.headers.get("content-type")
Expand Down

0 comments on commit 51412a5

Please sign in to comment.