Skip to content

Python: Fix samples discovered by auto validation pipeline#4355

Merged
TaoChenOSU merged 2 commits intomicrosoft:mainfrom
TaoChenOSU:taochen/python-fix-sample-by-auto-validation-pipeline
Mar 2, 2026
Merged

Python: Fix samples discovered by auto validation pipeline#4355
TaoChenOSU merged 2 commits intomicrosoft:mainfrom
TaoChenOSU:taochen/python-fix-sample-by-auto-validation-pipeline

Conversation

@TaoChenOSU
Copy link
Collaborator

@TaoChenOSU TaoChenOSU commented Feb 27, 2026

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 TaoChenOSU self-assigned this Feb 27, 2026
Copilot AI review requested due to automatic review settings February 27, 2026 18:53
@TaoChenOSU TaoChenOSU added the samples Issue relates to the samples label Feb 27, 2026
@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
Copy link
Contributor

Copilot AI left a comment

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.

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@TaoChenOSU TaoChenOSU enabled auto-merge February 27, 2026 19:04
@TaoChenOSU 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 samples Issue relates to the samples

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

4 participants