Skip to content

Commit

Permalink
get_messages endpoint null str edge case
Browse files Browse the repository at this point in the history
  • Loading branch information
josancamon19 committed Nov 30, 2024
1 parent 5b4f7ba commit 06b70a6
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions backend/routers/chat.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,9 @@ def create_initial_message(plugin_id: Optional[str], uid: str = Depends(auth.get

@router.get('/v1/messages', response_model=List[Message], tags=['chat'])
def get_messages(plugin_id: Optional[str] = None, uid: str = Depends(auth.get_current_user_uid)):
if plugin_id == 'null':
plugin_id = None

messages = chat_db.get_messages(uid, limit=100, include_memories=True, plugin_id=plugin_id)
if not messages:
return [initial_message_util(uid, plugin_id)]
Expand Down

0 comments on commit 06b70a6

Please sign in to comment.