Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -283,11 +283,11 @@ async def _aset_token_usage(
set_span_attribute(span, SpanAttributes.LLM_USAGE_TOTAL_TOKENS, total_tokens)

set_span_attribute(
span, GenAIAttributes.GEN_AI_USAGE_CACHE_READ_INPUT_TOKENS, cache_read_tokens
span, SpanAttributes.GEN_AI_USAGE_CACHE_READ_INPUT_TOKENS, cache_read_tokens
)
set_span_attribute(
span,
GenAIAttributes.GEN_AI_USAGE_CACHE_CREATION_INPUT_TOKENS,
SpanAttributes.GEN_AI_USAGE_CACHE_CREATION_INPUT_TOKENS,
cache_creation_tokens,
)

Expand Down Expand Up @@ -397,11 +397,11 @@ def _set_token_usage(
set_span_attribute(span, SpanAttributes.LLM_USAGE_TOTAL_TOKENS, total_tokens)

set_span_attribute(
span, GenAIAttributes.GEN_AI_USAGE_CACHE_READ_INPUT_TOKENS, cache_read_tokens
span, SpanAttributes.GEN_AI_USAGE_CACHE_READ_INPUT_TOKENS, cache_read_tokens
)
set_span_attribute(
span,
GenAIAttributes.GEN_AI_USAGE_CACHE_CREATION_INPUT_TOKENS,
SpanAttributes.GEN_AI_USAGE_CACHE_CREATION_INPUT_TOKENS,
cache_creation_tokens,
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,7 @@ def set_chat_response_usage(
)
_set_span_attribute(
span,
GenAIAttributes.GEN_AI_USAGE_CACHE_READ_INPUT_TOKENS,
SpanAttributes.GEN_AI_USAGE_CACHE_READ_INPUT_TOKENS,
cache_read_tokens,
)
if record_token_usage:
Expand Down