Skip to content

Is Workflow Streams intended as the message-queue bridge for PydanticAI's TemporalAgent event_stream_handler? #1661

Description

@Anjayg

Pydantic AI's Temporal docs state that Agent.run_stream()/run_stream_events()/iter() aren't supported inside a Temporal-backed run, and instead recommend an event_stream_handler on TemporalAgent, noting that getting events from the handler (running inside an activity) out to the workflow/frontend requires "an external system... like a message queue."
Question: Is Workflow Streams (temporalio.contrib.workflow_streams) the intended/recommended implementation of that "message queue" for this use case — i.e., publishing from within an event_stream_handler via WorkflowStreamClient.from_within_activity(), and having an external HTTP/API layer subscribe to the same workflow's stream to receive those events? Or is there a different pattern the SDK team recommends for bridging activity-side streaming output to an external consumer?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    ai-sdkRelated to AI integrationsenhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions