Replies: 1 comment
-
|
You don't need to - from the point of view of the agent, the SDK abstracts away the distinction between streaming and non-streaming. Just write the agent as if it were a streaming agent and the SDK will ensure it works properly with non-streaming clients too. Just call TaskUpdater.update_status() from your agent executor execute() method each time the agent itself yields another piece of the response. If the client is non-streaming then it will get only the final task result. If it is streaming then it will incrementally get each individual update. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
In the HelloWorld program of the example, both
client.send_message(request)andclient.send_message_streaming(streaming_request)will execute theHelloWorldAgentExecutor.executemethod. So how can we distinguish between these two invocation methods within theexecutemethod? It seems there is no attribute in the currentcontextto identify the difference.(In fact, the current HelloWorld program does not well demonstrate the characteristics of streaming.) I think if we can distinguish the caller, I can call the agent's
invokemethod andstreammethod separately in theexecutemethod.Beta Was this translation helpful? Give feedback.
All reactions