Skip to content

[agents docs] update pipelines.md: #13570

Open
yiyixuxu wants to merge 3 commits intomainfrom
update-pipelines-md
Open

[agents docs] update pipelines.md: #13570
yiyixuxu wants to merge 3 commits intomainfrom
update-pipelines-md

Conversation

@yiyixuxu
Copy link
Copy Markdown
Collaborator

adding a little bit tip on how we structure the pipeline

Adds a gotcha covering when a pipeline method should be public (a step
in __call__'s lifecycle) vs private/module-level (only used by another
method), and the preference to absorb single-use helpers when small.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@github-actions github-actions Bot added the size/S PR with diff < 50 LOC label Apr 28, 2026
@yiyixuxu yiyixuxu requested review from sayakpaul and stevhliu April 28, 2026 01:04
Copy link
Copy Markdown
Member

@stevhliu stevhliu left a comment

Choose a reason for hiding this comment

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

thanks!

Comment thread .ai/pipelines.md Outdated
Comment thread .ai/pipelines.md Outdated
yiyixuxu and others added 2 commits April 28, 2026 09:20
Co-authored-by: Steven Liu <59462357+stevhliu@users.noreply.github.com>
Co-authored-by: Steven Liu <59462357+stevhliu@users.noreply.github.com>
@github-actions github-actions Bot added size/S PR with diff < 50 LOC and removed size/S PR with diff < 50 LOC labels Apr 28, 2026
Copy link
Copy Markdown
Member

@sayakpaul sayakpaul left a comment

Choose a reason for hiding this comment

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

Just one comment.

Comment thread .ai/pipelines.md
Comment on lines +65 to +66
- **If a method is called from `__call__`, and it's a step in the pipeline lifecycle, make it public.** Each call from `__call__` should correspond to a step a user can identify: either a standard one (`encode_prompt`, `prepare_latents`, `set_timesteps`, …) or a pipeline-specific one (`prepare_src_latents`, `prepare_reference_audio_latents`, …). Don't gate these behind a `_`; they're part of the pipeline's API surface alongside their standard siblings.
- **If a method is only used by another method, make it private (`_foo`) or lift it to a module-level function — and keep the count down.** Before adding one, see if the logic can be absorbed into its caller. Unless you expect the helper to be reused by another method (or another task pipeline), absorbing is usually the better call — especially when the body is small. Avoid a pipeline class littered with private helpers that bury the lifecycle..
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Let's also provide examples for each?

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

Labels

size/S PR with diff < 50 LOC

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants