Skip to content

feat: Adds the ability to create hierarchical (nested) stages in Chat Completion responses. - #443

Open
korotaav48 wants to merge 2 commits into
epam:developmentfrom
korotaav48:feat/sub_stages
Open

korotaav48 wants to merge 2 commits into
epam:developmentfrom
korotaav48:feat/sub_stages

Conversation

@korotaav48

@korotaav48 korotaav48 commented Sep 9, 2026

Copy link
Copy Markdown

Applicable issues

Description of changes

  • Choice.create_stage() — added optional keyword argument parent: Stage | None to specify a parent stage
  • Stage — exposed a public stage_index property to retrieve the stage's index (needed to pass into parent=)
  • StartStageChunk — added parent_stage_index: int | None field; only included in the wire format when set (not None)
  • Covered by tests in tests/test_stage_parent_index.py

Usage example:
parent = choice.create_stage("Planning")
child = choice.create_stage("Step 1", parent=parent)

Checklist

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@korotaav48
korotaav48 requested a review from adubovik as a code owner September 9, 2026 13:24
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.

Support sub-stages (hierarchical stages) in Chat Completion responses

1 participant