()
| 38 | |
| 39 | |
| 40 | def test_sync_content(): |
| 41 | completion = client.chat.completions.create( |
| 42 | model="gpt-3.5-turbo", |
| 43 | messages=[{"role": "system", "content": "count to 3"}], |
| 44 | openpipe={"tags": {"prompt_id": "test_sync_content"}}, |
| 45 | ) |
| 46 | |
| 47 | if not TEST_LAST_LOGGED: |
| 48 | return |
| 49 | |
| 50 | last_logged = ( |
| 51 | client.openpipe_reporting_client.base_client.local_testing_only_get_latest_logged_call() |
| 52 | ) |
| 53 | assert last_logged.req_payload["messages"][0]["content"] == "count to 3" |
| 54 | assert ( |
| 55 | last_logged.resp_payload["choices"][0]["message"]["content"] |
| 56 | == completion.choices[0].message.content |
| 57 | ) |
| 58 | |
| 59 | |
| 60 | def test_sync_content_mistral(): |
nothing calls this directly
no test coverage detected