Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

introduce synchronous and asynchronous frame processors #436

Merged
merged 11 commits into from
Sep 19, 2024

Conversation

aconchillo
Copy link
Contributor

@aconchillo aconchillo commented Sep 1, 2024

Pipecat has a pipeline-based architecture. The pipeline consists of frame
processors linked to each other. The elements traveling across the pipeline are
called frames.

To have a deterministic behavior the frames traveling through the pipeline
should always be ordered, except system frames which are out-of-band frames. To
achieve that, each frame processor should only output frames from a single task.

There are synchronous and asynchronous frame processors. The synchronous
processors push output frames from the same task that they receive input frames,
and therefore only pushing frames from one task. Asynchronous frame processors
can have internal tasks to perform things asynchronously (e.g. receiving data
from a websocket) but they also have a single task where they push frames from.

@aconchillo aconchillo force-pushed the aleix/frameprocessor-single-task branch 3 times, most recently from 55a4867 to 9bbb824 Compare September 1, 2024 18:44
Copy link
Contributor

@kwindla kwindla left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks really nice. I will rebase my vision and tool-calling wip branches on top of this, to do more testing, just on general principles.

@aconchillo aconchillo force-pushed the aleix/frameprocessor-single-task branch from 0dec8be to 1673a5b Compare September 6, 2024 02:06
@aconchillo aconchillo force-pushed the aleix/frameprocessor-single-task branch 4 times, most recently from a44743f to bbbe553 Compare September 19, 2024 07:33
Pipecat has a pipeline-based architecture. The pipeline consists of frame
processors linked to each other. The elements travelling across the pipeline are
called frames.

To have a deterministic behavior the frames travelling through the pipeline
should always be ordered, except system frames which are out-of-band frames. To
achieve that, each frame processor should only output frames from a single task.

There are synchronous and asynchronous frame processors. The synchronous
processors push output frames from the same task that they receive input frames,
and therefore only pushing frames from one task. Asynchrnous frame processors
can have internal tasks to perform things asynchrnously (e.g. receiving data
from a websocket) but they also have a single task where they push frames from.
@aconchillo aconchillo force-pushed the aleix/frameprocessor-single-task branch from bbbe553 to 607a246 Compare September 19, 2024 08:32
@aconchillo aconchillo changed the title introduce FrameProcessor single async push frame task introduce synchronous and asynchronous frame processors Sep 19, 2024
Copy link
Contributor

@marcus-daily marcus-daily left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

@aconchillo aconchillo merged commit 1790fa4 into main Sep 19, 2024
2 of 3 checks passed
@aconchillo aconchillo deleted the aleix/frameprocessor-single-task branch October 23, 2024 20:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants