mirror of
https://github.com/encounter/adk-python.git
synced 2026-07-09 18:19:28 -07:00
feat: Pass event id as a metadata when it is converted into a message
PiperOrigin-RevId: 860929058
This commit is contained in:
committed by
Copybara-Service
parent
324796b4fe
commit
85434e293f
@@ -131,6 +131,7 @@ def _get_context_metadata(
|
||||
_get_adk_metadata_key("session_id"): invocation_context.session.id,
|
||||
_get_adk_metadata_key("invocation_id"): event.invocation_id,
|
||||
_get_adk_metadata_key("author"): event.author,
|
||||
_get_adk_metadata_key("event_id"): event.id,
|
||||
}
|
||||
|
||||
# Add optional metadata fields if present
|
||||
@@ -479,7 +480,6 @@ def _create_status_update_event(
|
||||
task_id: Optional task ID to use for generated events.
|
||||
context_id: Optional Context ID to use for generated events.
|
||||
|
||||
|
||||
Returns:
|
||||
A TaskStatusUpdateEvent with RUNNING state.
|
||||
"""
|
||||
|
||||
@@ -56,6 +56,7 @@ class TestEventConverter:
|
||||
self.mock_invocation_context.artifact_service = self.mock_artifact_service
|
||||
|
||||
self.mock_event = Mock(spec=Event)
|
||||
self.mock_event.id = None
|
||||
self.mock_event.invocation_id = "test-invocation-id"
|
||||
self.mock_event.author = "test-author"
|
||||
self.mock_event.branch = None
|
||||
@@ -130,6 +131,7 @@ class TestEventConverter:
|
||||
f"{ADK_METADATA_KEY_PREFIX}session_id",
|
||||
f"{ADK_METADATA_KEY_PREFIX}invocation_id",
|
||||
f"{ADK_METADATA_KEY_PREFIX}author",
|
||||
f"{ADK_METADATA_KEY_PREFIX}event_id",
|
||||
]
|
||||
|
||||
for key in expected_keys:
|
||||
|
||||
Reference in New Issue
Block a user