Create a new conversation for a project.
(project_dir: Path, project_name: str, title: Optional[str] = None)
| 136 | # ============================================================================ |
| 137 | |
| 138 | def create_conversation(project_dir: Path, project_name: str, title: Optional[str] = None) -> Conversation: |
| 139 | """Create a new conversation for a project.""" |
| 140 | session = get_session(project_dir) |
| 141 | try: |
| 142 | conversation = Conversation( |
| 143 | project_name=project_name, |
| 144 | title=title, |
| 145 | ) |
| 146 | session.add(conversation) |
| 147 | session.commit() |
| 148 | session.refresh(conversation) |
| 149 | logger.info(f"Created conversation {conversation.id} for project {project_name}") |
| 150 | return conversation |
| 151 | finally: |
| 152 | session.close() |
| 153 | |
| 154 | |
| 155 | def get_conversations(project_dir: Path, project_name: str) -> list[dict]: |
no test coverage detected