Skip to content

Commit

Permalink
fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
Yun-Kim committed Dec 31, 2024
1 parent b7fbbb0 commit 0ceb32f
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions tests/contrib/openai/test_openai_llmobs.py
Original file line number Diff line number Diff line change
Expand Up @@ -521,7 +521,9 @@ async def test_chat_completion_azure_async(
@pytest.mark.skipif(
parse_version(openai_module.version.VERSION) < (1, 26), reason="Stream options only available openai >= 1.26"
)
def test_chat_completion_stream_explicit_no_tokens(self, openai, ddtrace_global_config, mock_llmobs_writer, mock_tracer):
def test_chat_completion_stream_explicit_no_tokens(
self, openai, ddtrace_global_config, mock_llmobs_writer, mock_tracer
):
"""Ensure llmobs records are emitted for chat completion endpoints when configured.
Also ensure the llmobs records have the correct tagging including trace/span ID for trace correlation.
Expand All @@ -538,7 +540,11 @@ def test_chat_completion_stream_explicit_no_tokens(self, openai, ddtrace_global_
expected_completion = "The Los Angeles Dodgers won the World Series in 2020."
client = openai.OpenAI()
resp = client.chat.completions.create(
model=model, messages=input_messages, stream=True, user="ddtrace-test", stream_options={"include_usage": False},
model=model,
messages=input_messages,
stream=True,
user="ddtrace-test",
stream_options={"include_usage": False},
)
for chunk in resp:
resp_model = chunk.model
Expand Down

0 comments on commit 0ceb32f

Please sign in to comment.