diff --git a/api/handler.py b/api/handler.py index 8102e97..47b8fd5 100644 --- a/api/handler.py +++ b/api/handler.py @@ -118,7 +118,10 @@ async def handle(incoming_request: fastapi.Request): for message in payload.get('messages', []): if message.get('role') == 'user': - inp += message.get('content', '') + '\n' + try: + inp += message.get('content', '') + '\n' + except TypeError: + inp += message['content'][0]['text'] + '\n' if 'functions' in payload: inp += '\n'.join([function.get('description', '') for function in payload.get('functions', [])])