mirror of
https://github.com/microsoft/agent-framework.git
synced 2026-06-16 21:04:09 +08:00
aab621f5eb
* Fix tool normalization and provider samples - restore callable/single-tool normalization paths and unset tool-choice behavior\n- consolidate and expand chat/provider samples (OpenAI/Azure/Anthropic/Ollama/Bedrock)\n- migrate Bedrock lazy import surface to agent_framework.amazon and move provider samples Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * small fix in sample * Finalize provider, samples, and core cleanup Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * Fix CopilotTool passthrough in agent Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * fix link --------- Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
37 lines
1.3 KiB
Markdown
37 lines
1.3 KiB
Markdown
# 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
|
|
|
|
```bash
|
|
pip install agent-framework --pre
|
|
```
|
|
|
|
Set the required environment variables:
|
|
|
|
```bash
|
|
export AZURE_AI_PROJECT_ENDPOINT="https://your-project-endpoint"
|
|
export AZURE_OPENAI_RESPONSES_DEPLOYMENT_NAME="gpt-4o" # optional, defaults to gpt-4o
|
|
```
|
|
|
|
## Samples
|
|
|
|
| # | File | What you'll learn |
|
|
|---|------|-------------------|
|
|
| 1 | [01_hello_agent.py](01_hello_agent.py) | Create your first agent and run it (streaming and non-streaming). |
|
|
| 2 | [02_add_tools.py](02_add_tools.py) | Define a function tool with `@tool` and attach it to an agent. |
|
|
| 3 | [03_multi_turn.py](03_multi_turn.py) | Keep conversation history across turns with `AgentThread`. |
|
|
| 4 | [04_memory.py](04_memory.py) | Add dynamic context with a custom `ContextProvider`. |
|
|
| 5 | [05_first_workflow.py](05_first_workflow.py) | Chain executors into a workflow with edges. |
|
|
| 6 | [06_host_your_agent.py](06_host_your_agent.py) | Host a single agent with Azure Functions. |
|
|
|
|
Run any sample with:
|
|
|
|
```bash
|
|
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](../02-agents/providers/README.md)
|