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 f2c109c commit f5b231b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion aaq/tests/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ def post_search(self, request):
def post_search_return_empty(self, request):
resp_body = {"detail": "Gibberish text detected: vyjhftgdfdgt"}

return (200, {}, json.dumps(resp_body))
return (400, {}, json.dumps(resp_body))


class FakeAaqUdV2Api:
Expand Down
2 changes: 1 addition & 1 deletion aaq/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ def search(query_text, generate_llm_response, query_metadata):

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

if "detail" in response.json():
if response.status_code == 400 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 f5b231b

Please sign in to comment.