()
| 32 | |
| 33 | |
| 34 | async def test_async_content(): |
| 35 | completion = await client.chat.completions.create( |
| 36 | model="gpt-3.5-turbo", |
| 37 | messages=[{"role": "system", "content": "count to 3"}], |
| 38 | openpipe={"tags": {"prompt_id": "test_async_content"}}, |
| 39 | ) |
| 40 | |
| 41 | if not TEST_LAST_LOGGED: |
| 42 | return |
| 43 | |
| 44 | await asyncio.sleep(0.1) |
| 45 | last_logged = ( |
| 46 | await client.openpipe_reporting_client.base_client.local_testing_only_get_latest_logged_call() |
| 47 | ) |
| 48 | assert last_logged.req_payload["messages"][0]["content"] == "count to 3" |
| 49 | assert ( |
| 50 | last_logged.resp_payload["choices"][0]["message"]["content"] |
| 51 | == completion.choices[0].message.content |
| 52 | ) |
| 53 | |
| 54 | |
| 55 | async def test_async_content_mistral(): |
nothing calls this directly
no test coverage detected