Skip to content

Commit 6e13d6c

Browse files
authored
add chat_history json to the report upload (#3799)
1 parent 2bd0090 commit 6e13d6c

File tree

1 file changed

+6
-0
lines changed
  • livekit-agents/livekit/agents/telemetry

1 file changed

+6
-0
lines changed

livekit-agents/livekit/agents/telemetry/traces.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -311,6 +311,12 @@ def _log(body: str, attributes: dict) -> None:
311311
part.headers["Content-Type"] = "application/protobuf"
312312
part.headers["Content-Length"] = str(len(header_bytes))
313313

314+
chat_history_json = json.dumps(report.chat_history.to_dict(exclude_timestamp=False))
315+
part = mp.append(chat_history_json)
316+
part.set_content_disposition("form-data", name="chat_history", filename="chat_history.json")
317+
part.headers["Content-Type"] = "application/json"
318+
part.headers["Content-Length"] = str(len(chat_history_json))
319+
314320
if report.audio_recording_path and report.audio_recording_started_at:
315321
try:
316322
async with aiofiles.open(report.audio_recording_path, "rb") as f:

0 commit comments

Comments
 (0)