Skip to content

Commit

Permalink
Merge pull request #184 from nulib/remove_full_text
Browse files Browse the repository at this point in the history
Temporarily removes full_text from vector searches
  • Loading branch information
bmquinn authored Feb 5, 2024
2 parents 1d7908a + d0fc381 commit 2fe8c1a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion chat/src/event_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ def _get_attributes(self):
attributes = [
item
for item in self._get_request_attributes()
if item not in [self._get_text_key(), "source"]
if item not in [self._get_text_key(), "source", "full_text"]
]
return attributes

Expand Down
8 changes: 6 additions & 2 deletions chat/src/handlers/chat.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
from event_config import EventConfig
from helpers.response import prepare_response


def handler(event, _context):
try:
config = EventConfig(event)
Expand All @@ -21,5 +20,10 @@ def handler(event, _context):
final_response = prepare_response(config)
config.socket.send(final_response)
return {"statusCode": 200}

except Exception as err:
raise err
if err.__class__.__name__ == "PayloadTooLargeException":
config.socket.send({"type": "error", "message": "Payload too large"})
return {"statusCode": 413, "body": "Payload too large"}
else:
raise err

0 comments on commit 2fe8c1a

Please sign in to comment.