Skip to content

Commit

Permalink
fix(sdk): Fixed token propagation in spans
Browse files Browse the repository at this point in the history
  • Loading branch information
mmabrouk committed Jun 6, 2024
1 parent a0cf1e8 commit 12bde7c
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions agenta-cli/agenta/sdk/tracing/llm_tracing.py
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,8 @@ def _update_span_cost(self, span: CreateSpan, cost: Optional[float]):
span.cost += cost

def _update_span_tokens(self, span: CreateSpan, tokens: Optional[dict]):
if isinstance(tokens, LlmTokens):
tokens = tokens.dict()
if tokens is not None and isinstance(tokens, dict):
if span.tokens is None:
span.tokens = LlmTokens(**tokens)
Expand Down

0 comments on commit 12bde7c

Please sign in to comment.