Fix snippet tag to exclude return statement from code excerpt#659
Closed
jonburchel wants to merge 1 commit intomicrosoft-foundry:mainfrom
Closed
Fix snippet tag to exclude return statement from code excerpt#659jonburchel wants to merge 1 commit intomicrosoft-foundry:mainfrom
jonburchel wants to merge 1 commit intomicrosoft-foundry:mainfrom
Conversation
Move the closing </create_agent_with_tools> snippet tag to before the 'return agent' line so the rendered documentation snippet does not show a 'return' statement outside a function body. Fixes: OPS-E2E-PPE/azure-ai-docs-pr#4968 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
👋 Thanks for your contribution, @jonburchel! This repository is read-only. As a Microsoft contributor, please submit your PR to the private staging repository instead: See CONTRIBUTING.md for full instructions. |
Contributor
Author
|
Closing - will resubmit to foundry-samples-pr per contribution guidelines. |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Fix: Snippet tag excludes
returnoutside function bodyProblem
The
create_agent_with_toolssnippet tag inmain.pyincludes thereturn agentline. When rendered as a documentation code excerpt on Microsoft Learn, thisreturnstatement appears outside any function definition, triggering a code validation error:Source issue: OPS-E2E-PPE/azure-ai-docs-pr#4968
Fix
Move the closing
# </create_agent_with_tools>tag to before thereturn agentline. Thereturnstatement is part of the enclosing function but adds no educational value to the snippet; removing it from the excerpt makes the snippet syntactically self-contained.Affected article