File tree Expand file tree Collapse file tree 1 file changed +12
-2
lines changed
livekit-agents/livekit/agents/telemetry Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -245,21 +245,31 @@ def _to_log_chat_item(item: ChatItem) -> map[str, any] | None:
245245 }
246246
247247 elif item .type == "function_call" :
248+ try :
249+ arguments = json .loads (item .arguments )
250+ except :
251+ arguments = item .arguments
252+
248253 return {
249254 "type" : item .type ,
250255 "id" : item .id ,
251256 "call_id" : item .call_id ,
252- "arguments" : json . loads ( item . arguments ) ,
257+ "arguments" : arguments ,
253258 "name" : item .name ,
254259 }
255260
256261 elif item .type == "function_call_output" :
262+ try :
263+ output = json .loads (item .output )
264+ except :
265+ output = item .output
266+
257267 return {
258268 "type" : item .type ,
259269 "id" : item .id ,
260270 "name" : item .name ,
261271 "call_id" : item .call_id ,
262- "output" : json . loads ( item . output ) ,
272+ "output" : output ,
263273 "is_error" : item .is_error ,
264274 }
265275
You can’t perform that action at this time.
0 commit comments