Skip to content

Commit e0ba380

Browse files
authored
fix(tracing): modify the index of the part on APMPlus (#120)
Co-authored-by: wuqingfu.528 <[email protected]>
1 parent f274d6c commit e0ba380

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

veadk/tracing/telemetry/attributes/extractors/llm_attributes_extractors.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,10 +103,11 @@ def llm_gen_ai_usage_cache_read_input_tokens(
103103
def llm_gen_ai_prompt(params: LLMAttributesParams) -> ExtractorResponse:
104104
# a part is a message
105105
messages: list[dict] = []
106+
idx = 0
106107

107108
for content in params.llm_request.contents:
108109
if content.parts:
109-
for idx, part in enumerate(content.parts):
110+
for part in content.parts:
110111
message = {}
111112
# text part
112113
if part.text:
@@ -141,6 +142,7 @@ def llm_gen_ai_prompt(params: LLMAttributesParams) -> ExtractorResponse:
141142

142143
if message:
143144
messages.append(message)
145+
idx += 1
144146

145147
return ExtractorResponse(content=messages)
146148

0 commit comments

Comments
 (0)