Skip to content

Commit a2fe60e

Browse files
fix(openai-v2): remove unused time import from reproducer
Co-authored-by: Cursor <cursoragent@cursor.com>
1 parent 57328ce commit a2fe60e

1 file changed

Lines changed: 10 additions & 6 deletions

File tree

instrumentation-genai/opentelemetry-instrumentation-openai-v2/examples/scripts/reproduce_raw_response_streaming.py

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@
2424
"""
2525

2626
import asyncio
27-
import time
2827
from unittest.mock import AsyncMock, MagicMock, patch
2928

3029
import httpx
@@ -84,16 +83,19 @@ async def aiter_bytes(_chunk_size=None):
8483
# Verbatim copy of LiteLLM's make_azure_openai_chat_completion_request
8584
# (litellm/llms/azure/azure.py lines 154-179)
8685
# ---------------------------------------------------------------------------
87-
async def make_azure_openai_chat_completion_request(azure_client, data, timeout):
86+
async def make_azure_openai_chat_completion_request(
87+
azure_client, data, timeout
88+
):
8889
"""
8990
Helper to:
9091
- call chat.completions.create.with_raw_response when litellm.return_response_headers is True
9192
- call chat.completions.create by default
9293
"""
93-
start_time = time.time()
9494
try:
95-
raw_response = await azure_client.chat.completions.with_raw_response.create(
96-
**data, timeout=timeout
95+
raw_response = (
96+
await azure_client.chat.completions.with_raw_response.create(
97+
**data, timeout=timeout
98+
)
9799
)
98100

99101
headers = dict(raw_response.headers)
@@ -157,7 +159,9 @@ async def reproducer():
157159
print(f"✓ OTel spans: {[s.name for s in spans]}")
158160

159161
instrumentor.uninstrument()
160-
print("\nReproducer passed — 'StreamWrapper' has no attribute 'headers' is fixed.")
162+
print(
163+
"\nReproducer passed — 'StreamWrapper' has no attribute 'headers' is fixed."
164+
)
161165

162166

163167
if __name__ == "__main__":

0 commit comments

Comments
 (0)