Get a specific conversation with all messages.
(project_name: str, conversation_id: int)
| 92 | |
| 93 | @router.get("/conversations/{project_name}/{conversation_id}", response_model=ConversationDetail) |
| 94 | async def get_project_conversation(project_name: str, conversation_id: int): |
| 95 | """Get a specific conversation with all messages.""" |
| 96 | if not validate_project_name(project_name): |
| 97 | raise HTTPException(status_code=400, detail="Invalid project name") |
| 98 | |
| 99 | project_dir = _get_project_path(project_name) |
| 100 | if not project_dir or not project_dir.exists(): |
| 101 | raise HTTPException(status_code=404, detail="Project not found") |
| 102 | |
| 103 | conversation = get_conversation(project_dir, conversation_id) |
| 104 | if not conversation: |
| 105 | raise HTTPException(status_code=404, detail="Conversation not found") |
| 106 | |
| 107 | return ConversationDetail( |
| 108 | id=conversation["id"], |
| 109 | project_name=conversation["project_name"], |
| 110 | title=conversation["title"], |
| 111 | created_at=conversation["created_at"], |
| 112 | updated_at=conversation["updated_at"], |
| 113 | messages=[ConversationMessageModel(**m) for m in conversation["messages"]], |
| 114 | ) |
| 115 | |
| 116 | |
| 117 | @router.post("/conversations/{project_name}", response_model=ConversationSummary) |
nothing calls this directly
no test coverage detected