Files
agent-framework/python/samples/01-get-started
T
Eduard van Valkenburg b065a4ce51 Python: [BREAKING] update context provider APIs, middleware, and per-service-call history persistence (#4992)
* Rename provider base APIs

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

* Allow provider-added chat and function middleware

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

* Simulate service-stored history per model call

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

* Fix typing regressions in CI

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

* Fix response ID suppression review feedback

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

* Rename per-service-call history persistence APIs

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

* Address context persistence review feedback

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

* Stabilize markdown sample docs

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

* Persist service continuation state per call

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

---------

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
b065a4ce51 ยท 2026-04-01 16:13:11 +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 --pre

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_first_workflow.py Chain executors into a workflow with edges.
6 06_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