Skip to content
Discussion options

You must be logged in to vote

The session history can contain both user messages and agent responses. The Runner appends each new user message as an event with author="user".

After the run, fetch the session and inspect all of its events:

session = await session_service.get_session(
    app_name=app_name,
    user_id=user_id,
    session_id=session_id,
)
if session is not None:
    for event in session.events:
        if event.content is not None:
            print(event.author, event.content)

The /apps/{app_name}/users/{user_id}/sessions/{session_id} endpoint returns that session. The live run_async()/SSE output need not echo the input message back, even though the session stores it.

If the fetched history contains o…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by sanketpatil06
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