Skip to content

Python: Fix samples discovered by auto validation pipeline - #4355

Merged
Tao Chen (TaoChenOSU) merged 2 commits into
microsoft:mainfrom
TaoChenOSU:taochen/python-fix-sample-by-auto-validation-pipeline
Mar 2, 2026
Merged

Python: Fix samples discovered by auto validation pipeline#4355
Tao Chen (TaoChenOSU) merged 2 commits into
microsoft:mainfrom
TaoChenOSU:taochen/python-fix-sample-by-auto-validation-pipeline

Conversation

@TaoChenOSU

@TaoChenOSU Tao Chen (TaoChenOSU) commented Feb 27, 2026

Copy link
Copy Markdown
Contributor

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

  • The code builds clean without any errors or warnings
  • The PR follows the Contribution Guidelines
  • All unit tests pass, and I have added new tests where possible
  • Is this a breaking change? If yes, add "[BREAKING]" prefix to the title of the PR.

@TaoChenOSU Tao Chen (TaoChenOSU) self-assigned this Feb 27, 2026
@TaoChenOSU Tao Chen (TaoChenOSU) added the python Usage: [Issues, PRs], Target: Python label Feb 27, 2026
Copilot AI review requested due to automatic review settings February 27, 2026 18:53
@github-actions github-actions Bot changed the title Fix samples discovered by auto validation pipeline Python: Fix samples discovered by auto validation pipeline Feb 27, 2026

Copilot AI left a comment

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.

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] into get_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.

Comment thread python/samples/02-agents/devui/in_memory_mode.py Outdated
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@TaoChenOSU
Tao Chen (TaoChenOSU) added this pull request to the merge queue Mar 2, 2026
Merged via the queue into microsoft:main with commit 7d374f0 Mar 2, 2026
28 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

python Usage: [Issues, PRs], Target: Python

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

5 participants