async def update_chat(
    *,
    db: AsyncSession = Depends(get_db),
    chat_id: UUID,
    chat_in: schemas.ChatUpdate,
    user: schemas.User = Depends(get_user),
) -> schemas.Chat:
    """Update a chat.

    Args:
    ----
        db: The database session.
        chat_id: The ID of the chat to update.
        chat_in: The chat update data.
        user: The current user.

    Returns:
    -------
        schemas.Chat: The updated chat.
    """
    chat = await crud.chat.get(db=db, id=chat_id, current_user=user)
    if not chat:
        raise HTTPException(status_code=status.HTTP_404_NOT_FOUND, detail="Chat not found")

    chat = await crud.chat.update(db=db, db_obj=chat, obj_in=chat_in, current_user=user)
    return chat
Update a chat.

    Args:
    ----
        db: The database session.
        chat_id: The ID of the chat to update.
        chat_in: The chat update data.
        user: The current user.

    Returns:
    -------
        schemas.Chat: The updated chat.
    
backend/airweave/api/v1/endpoints/chat.py