Python: Fix samples discovered by auto validation pipeline#4355
Merged
TaoChenOSU merged 2 commits intomicrosoft:mainfrom Mar 2, 2026
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Fixes failing samples discovered by the auto sample validation pipeline by aligning sample code and configuration with current client APIs and CI secret naming.
Changes:
- Update the DevUI in-memory sample to use
AzureOpenAIChatClient(endpoint=..., deployment_name=...)parameters. - Fix the custom chat client sample to pass
Sequence[Message]intoget_response()(instead of a raw string). - Normalize OpenAI API key environment variable naming in declarative sample YAML and in the Python sample validation workflow.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| python/samples/02-agents/devui/in_memory_mode.py | Updates Azure OpenAI chat client initialization and minor formatting changes. |
| python/samples/02-agents/chat_client/custom_chat_client.py | Fixes direct get_response() invocation to use message objects and improves formatting. |
| agent-samples/openai/OpenAIResponses.yaml | Updates declarative sample to reference OPENAI_API_KEY env var. |
| .github/workflows/python-sample-validation.yml | Switches workflow to use the OPENAI__APIKEY secret while still exporting OPENAI_API_KEY. |
giles17
approved these changes
Feb 27, 2026
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
eavanvalkenburg
approved these changes
Mar 2, 2026
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.
Motivation and Context
We have discovered many failing samples by the auto sample validation pipeline.
Description
This PR fixes a few of those sample and add the correct OpenAI key to the pipeline.
Contribution Checklist