(
self, cid, title=None, persona_id=None, content=None, token_usage=None
)
| 364 | return new_conversation |
| 365 | |
| 366 | async def update_conversation( |
| 367 | self, cid, title=None, persona_id=None, content=None, token_usage=None |
| 368 | ): |
| 369 | async with self.get_db() as session: |
| 370 | session: AsyncSession |
| 371 | async with session.begin(): |
| 372 | query = update(ConversationV2).where( |
| 373 | col(ConversationV2.conversation_id) == cid, |
| 374 | ) |
| 375 | values = {} |
| 376 | if title is not None: |
| 377 | values["title"] = title |
| 378 | if persona_id is not None: |
| 379 | values["persona_id"] = persona_id |
| 380 | if content is not None: |
| 381 | values["content"] = content |
| 382 | if token_usage is not None: |
| 383 | values["token_usage"] = token_usage |
| 384 | if not values: |
| 385 | return None |
| 386 | query = query.values(**values) |
| 387 | await session.execute(query) |
| 388 | return await self.get_conversation_by_id(cid) |
| 389 | |
| 390 | async def delete_conversation(self, cid) -> None: |
| 391 | async with self.get_db() as session: |
nothing calls this directly
no test coverage detected