File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed
litellm/integrations/opik Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change 3
3
"""
4
4
5
5
import asyncio
6
+ from datetime import timezone
6
7
import json
7
8
import traceback
8
9
from typing import Dict , List
@@ -291,8 +292,8 @@ def _create_opik_payload( # noqa: PLR0915
291
292
"project_name" : project_name ,
292
293
"id" : trace_id ,
293
294
"name" : trace_name ,
294
- "start_time" : start_time .isoformat () + "Z" ,
295
- "end_time" : end_time .isoformat () + "Z" ,
295
+ "start_time" : start_time .astimezone ( timezone . utc ). isoformat (). replace ( "+00:00" , "Z" ) ,
296
+ "end_time" : end_time .astimezone ( timezone . utc ). isoformat (). replace ( "+00:00" , "Z" ) ,
296
297
"input" : input_data ,
297
298
"output" : output_data ,
298
299
"metadata" : metadata ,
@@ -312,8 +313,8 @@ def _create_opik_payload( # noqa: PLR0915
312
313
"parent_span_id" : parent_span_id ,
313
314
"name" : span_name ,
314
315
"type" : "llm" ,
315
- "start_time" : start_time .isoformat () + "Z" ,
316
- "end_time" : end_time .isoformat () + "Z" ,
316
+ "start_time" : start_time .astimezone ( timezone . utc ). isoformat (). replace ( "+00:00" , "Z" ) ,
317
+ "end_time" : end_time .astimezone ( timezone . utc ). isoformat (). replace ( "+00:00" , "Z" ) ,
317
318
"input" : input_data ,
318
319
"output" : output_data ,
319
320
"metadata" : metadata ,
You can’t perform that action at this time.
0 commit comments