We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ab656a0 commit 79910f9Copy full SHA for 79910f9
openlayer/llm_monitors.py
@@ -211,6 +211,8 @@ def stream_chunks():
211
raw_outputs.append(chunk.model_dump())
212
if i == 0:
213
first_token_time = time.time()
214
+ if i > 0:
215
+ num_of_completion_tokens = i + 1
216
217
delta = chunk.choices[0].delta
218
@@ -236,8 +238,6 @@ def stream_chunks():
236
238
] += delta.tool_calls[0].function.arguments
237
239
240
yield chunk
- if i > 0:
- num_of_completion_tokens = i + 1
241
end_time = time.time()
242
latency = (end_time - start_time) * 1000
243
# pylint: disable=broad-except
0 commit comments