(self)
| 31 | await self.db.delete("sessions", "project_id", Project.ID) |
| 32 | |
| 33 | async def test_completion(self): |
| 34 | await self.agent.async_chat_completion() |
| 35 | time.sleep(2) |
| 36 | sessions = await self.db.get("sessions", "id", "project_id", Project.ID) |
| 37 | llm_calls = await self.db.get("llms", "*", "session_id", sessions[0].get("id")) |
| 38 | |
| 39 | self.assertEqual( |
| 40 | llm_calls[0].get("prompt").get("messages")[0].get("content"), |
| 41 | "Say this is an async test", |
| 42 | ) |
| 43 | self.assertIsNotNone(sessions[0].get("id")) |
| 44 | |
| 45 | async def test_stream_completion(self): |
| 46 | await self.agent.async_chat_completion_stream() |
nothing calls this directly
no test coverage detected