@@ -26,11 +26,11 @@ def test_chat_completion_basic(client):
2626 ]
2727 )
2828
29- print (completion .choices [0 ].message )
30-
29+ print (completion .data . choices [0 ].message )
30+
3131 assert completion is not None
32- assert len (completion .choices ) > 0
33- assert completion .choices [0 ].message .content is not None
32+ assert len (completion .data . choices ) > 0
33+ assert completion .data . choices [0 ].message .content is not None
3434
3535def test_chat_completion_with_system_message (client ):
3636 completion = client .confidential_chat .create (
@@ -40,10 +40,10 @@ def test_chat_completion_with_system_message(client):
4040 {"role" : "user" , "content" : "Hello!" }
4141 ]
4242 )
43-
43+
4444 assert completion is not None
45- assert len (completion .choices ) > 0
46- assert completion .choices [0 ].message .content is not None
45+ assert len (completion .data . choices ) > 0
46+ assert completion .data . choices [0 ].message .content is not None
4747
4848@pytest .mark .asyncio
4949async def test_chat_completion_async (client ):
@@ -54,10 +54,10 @@ async def test_chat_completion_async(client):
5454 {"role" : "user" , "content" : "Hello!" }
5555 ]
5656 )
57-
57+
5858 assert completion is not None
59- assert len (completion .choices ) > 0
60- assert completion .choices [0 ].message .content is not None
59+ assert len (completion .data . choices ) > 0
60+ assert completion .data . choices [0 ].message .content is not None
6161
6262def test_chat_completion_stream (client ):
6363 completion = client .confidential_chat .create_stream (
@@ -70,15 +70,15 @@ def test_chat_completion_stream(client):
7070
7171 # Verify we get a valid stream
7272 assert completion is not None
73-
73+
7474 # Process the stream and verify chunks
7575 chunk_count = 0
7676 for chunk in completion :
7777 assert chunk is not None
78- assert chunk is not None
79- assert len (chunk .choices ) > 0
80- assert chunk .choices [0 ].delta is not None
78+ assert chunk . data is not None
79+ assert len (chunk .data . choices ) > 0
80+ assert chunk .data . choices [0 ].delta is not None
8181 chunk_count += 1
82-
82+
8383 # Verify we got multiple chunks
8484 assert chunk_count > 0
0 commit comments