Create a new conversation. Args: conversation_id: Unique identifier for the conversation Returns: New conversation dict
(conversation_id: str)
| 19 | |
| 20 | |
| 21 | def 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 | |
| 48 | def get_conversation(conversation_id: str) -> Optional[Dict[str, Any]]: |
nothing calls this directly
no test coverage detected