mirror of
https://github.com/BerriAI/litellm.git
synced 2026-10-10 03:28:53 +00:00
test(langfuse_otel): drain wire batches per poll instead of accumulating
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
This commit is contained in:
parent
7328bb86af
commit
bc6d6a516d
1 changed files with 1 additions and 4 deletions
|
|
@ -79,13 +79,10 @@ def _langfuse_rig(
|
|||
|
||||
|
||||
def _observation_span(collector: Wire, response_id: str) -> dict[str, object]:
|
||||
batches: Final[list[Request]] = [] # mutable-ok: drain() consumes the queue, so accumulating needs a mutable list
|
||||
|
||||
def spans() -> tuple[dict[str, object], ...]:
|
||||
batches.extend(collector.drain())
|
||||
return tuple(
|
||||
attributes
|
||||
for batch in batches
|
||||
for batch in collector.drain()
|
||||
for attributes in _span_attributes(batch.body)
|
||||
if attributes.get("llm.response.id") == response_id
|
||||
)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue