Python: Update getting started with workflows sample structure and README (#653)

* Update getting started with workflows sample structure and README

* Small updates

* Adjust getting started samples. Fix agent executor bug. Add workflow tests to unit test file.

* Fix resource links
This commit is contained in:
Evan Mattson
2025-09-09 15:06:22 +09:00
committed by GitHub
Unverified
parent 2472f35876
commit 2699b85285
20 changed files with 103 additions and 61 deletions
@@ -902,6 +902,14 @@ class AgentExecutor(Executor):
)
await ctx.add_event(AgentRunEvent(self.id, response))
full_conversation: list[ChatMessage] | None = None
if self._cache:
full_conversation = list(self._cache) + list(response.messages)
agent_response = AgentExecutorResponse(self.id, response, full_conversation=full_conversation)
await ctx.send_message(agent_response)
self._cache.clear()
@handler
async def from_response(self, prior: AgentExecutorResponse, ctx: WorkflowContext[AgentExecutorResponse]) -> None:
"""Enable seamless chaining: accept a prior AgentExecutorResponse as input.