Skip to content

Commit

Permalink
update gibberish response dict
Browse files Browse the repository at this point in the history
  • Loading branch information
Hlamallama committed Oct 22, 2024
1 parent eef7944 commit cacf785
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion aaq/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,10 @@ def search(query_text, generate_llm_response, query_metadata):

response = requests.request("POST", url, json=payload, headers=headers)

if response.status_code == status.HTTP_400_BAD_REQUEST and "detail" in response.json():
if (
response.status_code == status.HTTP_400_BAD_REQUEST
and "detail" in response.json()
):
error_detail = response.json().get("detail", "")
if "Gibberish text detected" in error_detail:
json_msg = {
Expand Down

0 comments on commit cacf785

Please sign in to comment.