From 827bfd3d3ecc34ac5f6a21003c785460d1b02d2b Mon Sep 17 00:00:00 2001 From: karpathy Date: Sat, 22 Nov 2025 15:08:53 -0800 Subject: Label maker add --- backend/storage.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'backend/storage.py') diff --git a/backend/storage.py b/backend/storage.py index dd17a1a..180111d 100644 --- a/backend/storage.py +++ b/backend/storage.py @@ -33,6 +33,7 @@ def create_conversation(conversation_id: str) -> Dict[str, Any]: conversation = { "id": conversation_id, "created_at": datetime.utcnow().isoformat(), + "title": "New Conversation", "messages": [] } @@ -96,6 +97,7 @@ def list_conversations() -> List[Dict[str, Any]]: conversations.append({ "id": data["id"], "created_at": data["created_at"], + "title": data.get("title", "New Conversation"), "message_count": len(data["messages"]) }) @@ -152,3 +154,19 @@ def add_assistant_message( }) save_conversation(conversation) + + +def update_conversation_title(conversation_id: str, title: str): + """ + Update the title of a conversation. + + Args: + conversation_id: Conversation identifier + title: New title for the conversation + """ + conversation = get_conversation(conversation_id) + if conversation is None: + raise ValueError(f"Conversation {conversation_id} not found") + + conversation["title"] = title + save_conversation(conversation) -- cgit v1.2.3