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

Function add_assistant_message

backend/storage.py:130–156  ·  view source on GitHub ↗

Add an assistant message with all 3 stages to a conversation. Args: conversation_id: Conversation identifier stage1: List of individual model responses stage2: List of model rankings stage3: Final synthesized response

(
    conversation_id: str,
    stage1: List[Dict[str, Any]],
    stage2: List[Dict[str, Any]],
    stage3: Dict[str, Any]
)

Source from the content-addressed store, hash-verified

128
129
130def add_assistant_message(
131 conversation_id: str,
132 stage1: List[Dict[str, Any]],
133 stage2: List[Dict[str, Any]],
134 stage3: Dict[str, Any]
135):
136 """
137 Add an assistant message with all 3 stages to a conversation.
138
139 Args:
140 conversation_id: Conversation identifier
141 stage1: List of individual model responses
142 stage2: List of model rankings
143 stage3: Final synthesized response
144 """
145 conversation = get_conversation(conversation_id)
146 if conversation is None:
147 raise ValueError(f"Conversation {conversation_id} not found")
148
149 conversation["messages"].append({
150 "role": "assistant",
151 "stage1": stage1,
152 "stage2": stage2,
153 "stage3": stage3
154 })
155
156 save_conversation(conversation)
157
158
159def update_conversation_title(conversation_id: str, title: str):

Callers

nothing calls this directly

Calls 2

save_conversationFunction · 0.85
get_conversationFunction · 0.70

Tested by

no test coverage detected