Skip to content

Python: Add sample for hosted agent with files - #5596

Merged
Tao Chen (TaoChenOSU) merged 8 commits into
mainfrom
feature/hosted-agent-with-files-sample
May 1, 2026
Merged

Python: Add sample for hosted agent with files#5596
Tao Chen (TaoChenOSU) merged 8 commits into
mainfrom
feature/hosted-agent-with-files-sample

Conversation

@TaoChenOSU

@TaoChenOSU Tao Chen (TaoChenOSU) commented Apr 30, 2026

Copy link
Copy Markdown
Contributor

Motivation and Context

Add a sample to show how to work with session files in hosted agent.

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 Apr 30, 2026
Copilot AI review requested due to automatic review settings April 30, 2026 20:52
@TaoChenOSU Tao Chen (TaoChenOSU) added the python Usage: [Issues, PRs], Target: Python label Apr 30, 2026
@github-actions github-actions Bot changed the title Add sample for hosted agent with files Python: Add sample for hosted agent with files Apr 30, 2026
@moonbox3 Evan Mattson (moonbox3) added the documentation Usage: [Issues, PRs], Target: documentation in the code base and learn docs label Apr 30, 2026

@github-actions github-actions Bot 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.

Automated Code Review

Reviewers: 4 | Confidence: 93% | Result: All clear

Reviewed: Correctness, Security Reliability, Test Coverage, Design Approach


Automated review by TaoChenOSU's agents

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

Adds a new Python hosted-agent sample demonstrating how to work with session-scoped files when hosting an Agent Framework agent on Foundry via the Responses protocol.

Changes:

  • Introduces a new responses/06_files sample (agent manifest, host code, docker assets, README, and example resources).
  • Updates sample documentation to reference required environment variables and adds a “Running the Agent Host” section in the basic sample.
  • Changes the responses/02_tools sample to allow shell tool execution without approvals.

Reviewed changes

Copilot reviewed 13 out of 16 changed files in this pull request and generated 8 comments.

Show a summary per file
File Description
python/samples/04-hosting/foundry-hosted-agents/README.md Adds the new “Files” sample to the sample index table.
python/samples/04-hosting/foundry-hosted-agents/responses/01_basic/README.md Adds a “Running the Agent Host” section linking to parent instructions.
python/samples/04-hosting/foundry-hosted-agents/responses/02_tools/main.py Changes the shell tool to approval_mode="never_require".
python/samples/04-hosting/foundry-hosted-agents/responses/04_foundry_toolbox/README.md Updates toolbox sample docs (including new env var guidance).
python/samples/04-hosting/foundry-hosted-agents/responses/06_files/README.md Documents the new “files in hosted session” workflow and example invocations.
python/samples/04-hosting/foundry-hosted-agents/responses/06_files/main.py Implements the hosted agent + toolbox filtering + local shell tool.
python/samples/04-hosting/foundry-hosted-agents/responses/06_files/requirements.txt Declares runtime dependencies for the sample.
python/samples/04-hosting/foundry-hosted-agents/responses/06_files/agent.yaml Adds hosted agent configuration for the sample.
python/samples/04-hosting/foundry-hosted-agents/responses/06_files/agent.manifest.yaml Adds Foundry deployment manifest including toolbox + model resources.
python/samples/04-hosting/foundry-hosted-agents/responses/06_files/Dockerfile Containerizes the new sample agent host.
python/samples/04-hosting/foundry-hosted-agents/responses/06_files/.dockerignore Excludes local-only files from the sample’s container build.
python/samples/04-hosting/foundry-hosted-agents/responses/06_files/.env.example Documents required env vars for running the sample.
python/samples/04-hosting/foundry-hosted-agents/responses/06_files/resources/contoso_q1_2026_report.txt Provides a fictional report used as upload/demo content.
python/samples/04-hosting/foundry-hosted-agents/responses/06_files/resources/start-a-session.png Screenshot used in sample docs.
python/samples/04-hosting/foundry-hosted-agents/responses/06_files/resources/session-started.png Screenshot used in sample docs.
python/samples/04-hosting/foundry-hosted-agents/responses/06_files/resources/file-upload-portal.png Screenshot used in sample docs.

Comment thread python/samples/04-hosting/foundry-hosted-agents/responses/06_files/README.md Outdated
Comment thread python/samples/04-hosting/foundry-hosted-agents/responses/06_files/README.md Outdated
Comment thread python/samples/04-hosting/foundry-hosted-agents/responses/06_files/README.md Outdated
Comment thread python/samples/04-hosting/foundry-hosted-agents/responses/06_files/main.py Outdated
Comment thread python/samples/04-hosting/foundry-hosted-agents/responses/06_files/README.md Outdated
Tao Chen (TaoChenOSU) and others added 6 commits April 30, 2026 14:06
…iles/README.md

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…iles/README.md

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…iles/README.md

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…oundry_toolbox/README.md

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…iles/README.md

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@TaoChenOSU
Tao Chen (TaoChenOSU) marked this pull request as ready for review April 30, 2026 21:38

@github-actions github-actions Bot 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.

Automated Code Review

Reviewers: 4 | Confidence: 91% | Result: All clear

Reviewed: Correctness, Security Reliability, Test Coverage, Design Approach


Automated review by TaoChenOSU's agents

Comment thread python/samples/04-hosting/foundry-hosted-agents/responses/06_files/main.py Outdated
@TaoChenOSU
Tao Chen (TaoChenOSU) added this pull request to the merge queue May 1, 2026
Merged via the queue into main with commit 18293ff May 1, 2026
33 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Usage: [Issues, PRs], Target: documentation in the code base and learn docs python Usage: [Issues, PRs], Target: Python

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

5 participants