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

Function add_user_message

backend/storage.py:110–127  ·  view source on GitHub ↗

Add a user message to a conversation. Args: conversation_id: Conversation identifier content: User message content

(conversation_id: str, content: str)

Source from the content-addressed store, hash-verified

108
109
110def add_user_message(conversation_id: str, content: str):
111 """
112 Add a user message to a conversation.
113
114 Args:
115 conversation_id: Conversation identifier
116 content: User message content
117 """
118 conversation = get_conversation(conversation_id)
119 if conversation is None:
120 raise ValueError(f"Conversation {conversation_id} not found")
121
122 conversation["messages"].append({
123 "role": "user",
124 "content": content
125 })
126
127 save_conversation(conversation)
128
129
130def add_assistant_message(

Callers

nothing calls this directly

Calls 2

save_conversationFunction · 0.85
get_conversationFunction · 0.70

Tested by

no test coverage detected