Skip to content
Discussion options

You must be logged in to vote

Response from ADK Answering Agent (experimental, answer may be inaccurate)

TLDR: You are on the right track! The recommended way to add any message or action to the session history is by creating an Event and appending it with session_service.append_event().


Hello! That's a great question. Your intuition to use session_service.append_event() is spot on. Every interaction in a session, whether from a user, an agent, or the system itself, should be recorded as an Event in the session's history. [3, 2]

Here’s how you can do it. You'll need to construct an Event object containing your message and then pass it to the append_event method.

Here is a complete example based on your code snippet:

i…

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by hangfei
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants