MCPcopy
hub / github.com/karpathy/llm-council / create_conversation

Function create_conversation

backend/storage.py:21–45  ·  view source on GitHub ↗

Create a new conversation. Args: conversation_id: Unique identifier for the conversation Returns: New conversation dict

(conversation_id: str)

Source from the content-addressed store, hash-verified

19
20
21def create_conversation(conversation_id: str) -> Dict[str, Any]:
22 """
23 Create a new conversation.
24
25 Args:
26 conversation_id: Unique identifier for the conversation
27
28 Returns:
29 New conversation dict
30 """
31 ensure_data_dir()
32
33 conversation = {
34 "id": conversation_id,
35 "created_at": datetime.utcnow().isoformat(),
36 "title": "New Conversation",
37 "messages": []
38 }
39
40 # Save to file
41 path = get_conversation_path(conversation_id)
42 with open(path, 'w') as f:
43 json.dump(conversation, f, indent=2)
44
45 return conversation
46
47
48def get_conversation(conversation_id: str) -> Optional[Dict[str, Any]]:

Callers

nothing calls this directly

Calls 2

ensure_data_dirFunction · 0.85
get_conversation_pathFunction · 0.85

Tested by

no test coverage detected