Files
agent-framework/python/samples/01-get-started
T
Evan Mattson 9b22ecd119 Python: Add requirements.txt and .env.example to the a2a/ sample for pip-based setup (#5510)
* Add requirements.txt and .env.example to a2a sample

Beginners following the a2a/ sample had no pip-based install path:
the directory lacked requirements.txt and .env.example, unlike every
other 04-hosting/ sample.

- Add requirements.txt with editable local package paths matching the
  pattern used in azure_functions/ and similar hosting samples
- Add .env.example documenting FOUNDRY_PROJECT_ENDPOINT, FOUNDRY_MODEL,
  and A2A_AGENT_HOST
- Update README Quick Start to cover both pip (.venv) and uv workflows

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Python: Add `requirements.txt` and `.env.example` to the `a2a/` sample for pip-based setup

Fixes #5395

* fix(a2a-sample): address PR review feedback for issue #5395

- Remove 'from repo root' wording from Option B uv heading in README
  to avoid contradicting the 'run from this directory' instruction
- Fix A2A_AGENT_HOST default in .env.example from 5001 to 5000 to match
  function-tools flow; add clarifying comments about port usage
- Add note for pip users explaining they can replace 'uv run python'
  with 'python' once the virtual environment is activated

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Address review feedback for #5395: Python: [Samples][Python] a2a/ sample missing requirements.txt — beginners cannot install dependencies

---------

Co-authored-by: Copilot <copilot@github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
9b22ecd119 · 2026-04-27 22:22:07 +00:00
History
..

Get Started with Agent Framework for Python

This folder contains a progressive set of samples that introduce the core concepts of Agent Framework one step at a time.

Prerequisites

pip install agent-framework

Set the required environment variables:

export FOUNDRY_PROJECT_ENDPOINT="https://your-project-endpoint"
export FOUNDRY_MODEL="gpt-4o"   # optional, defaults to gpt-4o

Samples

# File What you'll learn
1 01_hello_agent.py Create your first agent and run it (streaming and non-streaming).
2 02_add_tools.py Define a function tool with @tool and attach it to an agent.
3 03_multi_turn.py Keep conversation history across turns with AgentSession.
4 04_memory.py Add dynamic context with a custom ContextProvider.
5 05_functional_workflow_with_agents.py Call agents inside a functional workflow.
6 06_functional_workflow_basics.py Write a workflow as a plain async function.
7 07_first_graph_workflow.py Chain executors into a graph workflow with edges.
8 08_host_your_agent.py Host a single agent with Azure Functions.

Run any sample with:

python 01_hello_agent.py

These samples use Azure Foundry models with the Responses API. To switch providers, just replace the client, see all providers