Repository navigation
Python: Align and simplify get-started samples #9133
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
Merged
Eduard van Valkenburg (eavanvalkenburg)
merged 12 commits into
main
from
python-get-started-sample-cleanup
Oct 7, 2026
Merged
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
d5b2fdf
Python: Simplify getting-started samples
eavanvalkenburg 6d6e3dd
Python: Minimize remaining get-started samples
eavanvalkenburg 79cfaea
Python: Restore get-started sample context
eavanvalkenburg e54aabb
Python: Align get-started sample README
eavanvalkenburg 779f07f
Python: Document environment-based sample configuration
eavanvalkenburg d1fab14
Python: Require project-scoped Foundry endpoint examples
eavanvalkenburg 47b28c7
Python: Align get-started steps with docs
eavanvalkenburg 9231d55
Python: Put workflow basics first
eavanvalkenburg 017b23d
Python: Keep hosted sample on Foundry settings
eavanvalkenburg 89322d7
Python: Use hardcoded Foundry settings in hosting sample
eavanvalkenburg f6aeb15
Python: Use gpt-6-luna across get-started samples
eavanvalkenburg 54002dc
Python: Address get-started review feedback
eavanvalkenburg File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
33 changes: 33 additions & 0 deletions
33
python/samples/01-get-started/05a_functional_workflow_basics.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,33 @@ | ||
| # Copyright (c) Microsoft. All rights reserved. | ||
|
|
||
| """Compose two async functions into a functional workflow. | ||
|
|
||
| The workflow uppercases text, then reverses it using normal Python control flow. | ||
| """ | ||
|
|
||
| import asyncio | ||
|
|
||
| from agent_framework import workflow | ||
|
|
||
|
|
||
| async def to_upper_case(text: str) -> str: | ||
| return text.upper() | ||
|
|
||
|
|
||
| async def reverse_text(text: str) -> str: | ||
| return text[::-1] | ||
|
|
||
|
|
||
| @workflow | ||
| async def text_workflow(text: str) -> str: | ||
| upper = await to_upper_case(text) | ||
| return await reverse_text(upper) | ||
|
|
||
|
|
||
| async def main() -> None: | ||
| result = await text_workflow.build().run("hello world") | ||
| print(result.get_outputs()[0]) | ||
|
|
||
|
|
||
| if __name__ == "__main__": | ||
| asyncio.run(main()) |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.