Skip to content

feat(py): Add canonical framework samples for python#5327

Open
huangjeff5 wants to merge 1 commit into
mainfrom
jh-canonical-samples
Open

feat(py): Add canonical framework samples for python#5327
huangjeff5 wants to merge 1 commit into
mainfrom
jh-canonical-samples

Conversation

@huangjeff5
Copy link
Copy Markdown
Contributor

JS has a bunch of canonical flows in flow-sample1 to test all core framework features quickly. Adding this to Python as well.

@github-actions github-actions Bot added docs Improvements or additions to documentation python Python config labels May 14, 2026
Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request introduces a new sample project, flow-sample1, which demonstrates fundamental Genkit framework features in Python, including traced steps, streaming, and error handling. The sample includes various flow implementations and documentation. Feedback suggests removing a redundant string conversion in the parent flow to improve code clarity.


Demonstrates flow-from-flow: the inner trace nests under the outer one.
"""
return str(await basic('foo'))
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

The str() call is redundant here because the basic flow is already defined to return a str. Removing it makes the code cleaner and more idiomatic.

Suggested change
return str(await basic('foo'))
return await basic('foo')

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

Labels

config docs Improvements or additions to documentation python Python

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant