Skip to content

Commit

Permalink
Check if plugin is none in initial_message_util (#1274)
Browse files Browse the repository at this point in the history
  • Loading branch information
beastoin authored Nov 11, 2024
2 parents a40171b + 3319cf9 commit de79279
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions backend/routers/chat.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,11 +83,8 @@ def clear_chat_messages(uid: str = Depends(auth.get_current_user_uid)):

def initial_message_util(uid: str, plugin_id: Optional[str] = None):
plugin = get_app_by_id_db(plugin_id, uid)
if not plugin:
text = initial_chat_message(uid)
else:
plugin = App(**plugin)
text = initial_chat_message(uid, plugin)
plugin = App(**plugin) if plugin else None
text = initial_chat_message(uid, plugin)

ai_message = Message(
id=str(uuid.uuid4()),
Expand Down

0 comments on commit de79279

Please sign in to comment.