Save session on turn rather than at final response - #1550
Conversation
|
Addresses issue #1551 |
891074f to
c5e05ba
Compare
seratch
left a comment
There was a problem hiding this comment.
Thanks for taking the time to send this. At a glance, the changes look good, but we need unit tests verifying the patterns and we don't need the additional example.
| @@ -0,0 +1,116 @@ | |||
| import asyncio | |||
There was a problem hiding this comment.
instead of having this example, we need unit tests verifying the pattern
c5e05ba to
e98c3cd
Compare
|
I removed the example and added a unit test to There were a few linting and formatting issues that |
|
|
||
| type: Literal["input_audio_transcription_completed"] = "input_audio_transcription_completed" | ||
|
|
||
|
|
There was a problem hiding this comment.
can you remove these unrelated changes to make the review easier?
There was a problem hiding this comment.
can you remove these unrelated changes to make the review easier?
Of course! I removed the final commit that had all the make lint/check-format changes that weren't part of the bug fix.
e98c3cd to
c8a5d26
Compare
|
@seratch, I made the changes you were looking for. Would you like me to rebase or update the branch before you review? |
The current implementation of sessions saves the session on the final output. This works as a "memory" of previous full conversations, but does not work if you need access to the session during the turn. A use case for this is providing access to the full conversation to an agent-as-tool during the turn.
This PR updates the
runand_start_streamingmethods inrun.pyto save the session on each turn.The basic flow is:
Also included is an example file that shows the use of this pattern. It is an adapted version of the agents-as-tools example where a check agent is called within the same turn as the translation agents and examines their outputs via the conversation history, rather than as a generated input.
Resolves #1551