This repository is a lightweight playground for experimenting with the agent-framework-core
package and Azure OpenAI. It contains a simple Python chat client plus a set of companion
notebooks that demonstrate how to build and orchestrate agents with the magnetic workflow
building blocks.
| Path | Description |
|---|---|
chat_client.py |
Minimal agent chat loop that connects to Azure OpenAI via AzureOpenAIChatClient. |
config.py |
Loads configuration from .env and exposes Azure-specific constants. |
requirements.txt |
Runtime dependencies for the Python scripts and notebooks. |
simple_agent.ipynb / supervisor.ipynb / tool*.ipynb |
Notebook experiments that accompany the agent framework. |
.env.sample |
Template for the environment variables required by config.py. |
- Python 3.10 or newer
- Azure OpenAI resource with a GPT‑4o (or compatible) deployment
- (Optional) Jupyter Notebook or VS Code for exploring the notebooks
-
Create and activate a virtual environment:
python -m venv .venv source .venv/bin/activate # Windows: .venv\Scripts\activate
-
Install dependencies:
pip install -r requirements.txt
-
Configure secrets by copying the sample and filling in your values:
cp .env.sample .env
Required variables:
AZURE_OPENAI_ENDPOINTAZURE_OPENAI_API_KEYAZURE_OPENAI_DEPLOYMENT_GPT_4O_IDAZURE_OPENAI_DEPLOYMENT_ID(used byconfig.py, add this entry to.envas needed)
After setup, execute:
python chat_client.pyThe script instantiates AzureOpenAIChatClient, wires it into a MagenticBuilder, and streams
agent responses to the console. Adjust logging levels inside chat_client.py if you need more
verbose tracing.
- Launch Jupyter (or VS Code’s notebook interface).
- Open any of the
*.ipynbfiles:00.install.ipynbwalks through environment bootstrap steps.magentic_one.ipynbandsimple_agent.ipynbillustrate basic agent patterns.supervisor.ipynb,tool.ipynb, andtools.ipynbdemonstrate orchestration examples.
- Ensure the notebook kernel uses the same virtual environment that has the dependencies
installed and the
.envfile available so thatconfig.pycan resolve credentials.
- Auth failures: Double-check that the
.envfile contains the exact deployment IDs and endpoint/key for the Azure resource region you created. - Package import errors: Re-run
pip install -r requirements.txtinside the active environment to ensureagent-framework-coreand friends are available. - Notebook cannot find variables: Restart the kernel after editing
.env, or callload_dotenv()manually at the top of a notebook cell.
This is still a personal sandbox, so feel free to fork or adapt to your own Azure OpenAI setup. If you expand the framework usage (e.g., add tools or workflows), document them here to keep the README in sync.