Add a user message to a conversation. Args: conversation_id: Conversation identifier content: User message content
(conversation_id: str, content: str)
| 108 | |
| 109 | |
| 110 | def 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 | |
| 130 | def add_assistant_message( |
nothing calls this directly
no test coverage detected