(
self,
user_id,
platform_id,
content=None,
title=None,
persona_id=None,
cid=None,
created_at=None,
updated_at=None,
)
| 332 | return conversations, total |
| 333 | |
| 334 | async def create_conversation( |
| 335 | self, |
| 336 | user_id, |
| 337 | platform_id, |
| 338 | content=None, |
| 339 | title=None, |
| 340 | persona_id=None, |
| 341 | cid=None, |
| 342 | created_at=None, |
| 343 | updated_at=None, |
| 344 | ): |
| 345 | kwargs = {} |
| 346 | if cid: |
| 347 | kwargs["conversation_id"] = cid |
| 348 | if created_at: |
| 349 | kwargs["created_at"] = created_at |
| 350 | if updated_at: |
| 351 | kwargs["updated_at"] = updated_at |
| 352 | async with self.get_db() as session: |
| 353 | session: AsyncSession |
| 354 | async with session.begin(): |
| 355 | new_conversation = ConversationV2( |
| 356 | user_id=user_id, |
| 357 | content=content or [], |
| 358 | platform_id=platform_id, |
| 359 | title=title, |
| 360 | persona_id=persona_id, |
| 361 | **kwargs, |
| 362 | ) |
| 363 | session.add(new_conversation) |
| 364 | return new_conversation |
| 365 | |
| 366 | async def update_conversation( |
| 367 | self, cid, title=None, persona_id=None, content=None, token_usage=None |
nothing calls this directly
no test coverage detected