Skip to content

Commit 5fda66e

Browse files
authored
fix(litellm): patch async embeddings for auto instrumentation (#186)
Trace litellm.aembedding alongside the existing embedding path so patch_litellm() and wrap_litellm() cover async embedding calls. Add a VCR regression test and cassette to lock down the missing async embedding instrumentation reported in issue 115.
1 parent 07eae20 commit 5fda66e

5 files changed

Lines changed: 1034 additions & 4 deletions

File tree

py/src/braintrust/integrations/litellm/__init__.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,9 @@ def patch_litellm() -> bool:
88
"""Patch LiteLLM to add Braintrust tracing.
99
1010
This wraps litellm.completion, litellm.acompletion, litellm.responses,
11-
litellm.aresponses, litellm.embedding, and litellm.moderation to
12-
automatically create Braintrust spans with detailed token metrics,
11+
litellm.aresponses, litellm.embedding, litellm.aembedding, and
12+
litellm.moderation to automatically create Braintrust spans with
13+
detailed token metrics,
1314
timing, and costs.
1415
1516
Returns:

0 commit comments

Comments
 (0)