mirror of
https://github.com/BerriAI/litellm.git
synced 2026-10-06 02:48:13 +00:00
feat(agent_session_endpoints): serialize event rows with type/data wire fields
Renames event_type/payload -> type/data when projecting an AgentRunEvent row into a ConversationMessage so the /conversation endpoint output matches the SSE event frame and Cursor's API.
This commit is contained in:
parent
19f3f3210f
commit
dc39173849
1 changed files with 6 additions and 2 deletions
|
|
@ -98,10 +98,14 @@ def run_row_to_response(row: Any) -> RunResponse:
|
|||
|
||||
|
||||
def event_row_to_message(row: Any) -> ConversationMessage:
|
||||
# NOTE: the DB column is ``event_type``/``payload`` but the wire
|
||||
# shape we surface to SDK consumers is ``type``/``data`` (matches
|
||||
# Cursor's API + the SSE event frame in run_endpoints._sse_event_data).
|
||||
# Rename here so /conversation and the SSE stream agree.
|
||||
return ConversationMessage(
|
||||
run_id=row.run_id,
|
||||
seq=row.seq,
|
||||
event_type=row.event_type,
|
||||
payload=_as_dict(row.payload) or {},
|
||||
type=row.event_type,
|
||||
data=_as_dict(row.payload) or {},
|
||||
created_at=_iso(row.created_at),
|
||||
)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue