File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed
Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change 11import json
22
3-
43from veadk .tracing .telemetry .attributes .extractors .types import (
54 ExtractorResponse ,
65 LLMAttributesParams ,
@@ -105,7 +104,7 @@ def llm_gen_ai_usage_cache_read_input_tokens(
105104
106105
107106def llm_gen_ai_prompt (params : LLMAttributesParams ) -> ExtractorResponse :
108- # a content is a message
107+ # a part is a message
109108 messages : list [dict ] = []
110109
111110 for content in params .llm_request .contents :
@@ -119,8 +118,10 @@ def llm_gen_ai_prompt(params: LLMAttributesParams) -> ExtractorResponse:
119118 # function response
120119 if part .function_response :
121120 message [f"gen_ai.prompt.{ idx } .role" ] = content .role
122- message [f"gen_ai.prompt.{ idx } .content" ] = str (
123- content .parts [0 ].function_response
121+ message [f"gen_ai.prompt.{ idx } .content" ] = (
122+ str (content .parts [0 ].function_response .response )
123+ if content .parts [0 ].function_response
124+ else "<unknown_function_response>"
124125 )
125126 # function call
126127 if part .function_call :
You can’t perform that action at this time.
0 commit comments