Skip to content

Commit d1b8dbb

Browse files
committed
Fix openai tests
1 parent 0ae17f7 commit d1b8dbb

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

tests/integrations/openai/test_openai.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,8 @@ def test_nonstreaming_chat_completion(
6868
assert span["op"] == "ai.chat_completions.create.openai"
6969

7070
if send_default_pii and include_prompts:
71-
assert "hello" in span["data"]["ai.input_messages"][0]["content"]
72-
assert "the model response" in span["data"]["ai.responses"][0]["content"]
71+
assert "hello" in span["data"]["ai.input_messages"]["content"]
72+
assert "the model response" in span["data"]["ai.responses"]["content"]
7373
else:
7474
assert "ai.input_messages" not in span["data"]
7575
assert "ai.responses" not in span["data"]
@@ -147,8 +147,8 @@ def test_streaming_chat_completion(
147147
assert span["op"] == "ai.chat_completions.create.openai"
148148

149149
if send_default_pii and include_prompts:
150-
assert "hello" in span["data"]["ai.input_messages"][0]["content"]
151-
assert "hello world" in span["data"]["ai.responses"][0]
150+
assert "hello" in span["data"]["ai.input_messages"]["content"]
151+
assert "hello world" in span["data"]["ai.responses"]
152152
else:
153153
assert "ai.input_messages" not in span["data"]
154154
assert "ai.responses" not in span["data"]
@@ -219,7 +219,7 @@ def test_embeddings_create(
219219
span = tx["spans"][0]
220220
assert span["op"] == "ai.embeddings.create.openai"
221221
if send_default_pii and include_prompts:
222-
assert "hello" in span["data"]["ai.input_messages"][0]
222+
assert "hello" in span["data"]["ai.input_messages"]
223223
else:
224224
assert "ai.input_messages" not in span["data"]
225225

0 commit comments

Comments
 (0)