Microsoft Agent Framework Quickstart
This runs the example from a clone of the monorepo. The backend is a uvicorn process on port 5330; the Angular dev server is on port 4330 and proxies /agent to it.
Node.js 20 or newer, Python 3.12 or newer, uv, and either an Azure OpenAI resource or an OpenAI API key.
git clone https://github.com/cacheplane/angular-agent-framework.git
cd angular-agent-framework
npm ciCopy the example file and fill in whichever model path you are using.
cp cockpit/runtimes/microsoft-agent-framework/python/.env.example \
cockpit/runtimes/microsoft-agent-framework/python/.envAzure OpenAI is the default path. Setting AZURE_OPENAI_ENDPOINT selects it; leaving it unset selects the OpenAI fallback.
| Variable | Required | Purpose |
|---|---|---|
AZURE_OPENAI_ENDPOINT | For Azure | Resource endpoint. Its presence is what selects the Azure path. |
AZURE_OPENAI_API_KEY | For Azure | Key authentication against that resource. |
AZURE_OPENAI_MODEL | For Azure | Deployment name of a chat model, not a public model id. |
AZURE_OPENAI_API_VERSION | No | Read by the Azure client, not by the example code. .env.example ships 2024-12-01-preview. |
OPENAI_API_KEY | For the fallback | Used only when AZURE_OPENAI_ENDPOINT is unset. |
OPENAI_CHAT_MODEL | No | Model name for the fallback path. |
OPENAI_BASE_URL | No | Redirects the OpenAI client. The end-to-end fixture harness sets this to replay recorded calls. |
Azure addresses models by the deployment name you chose in your resource, which is frequently not the public model id. A valid key paired with a public model id fails as a missing deployment.
One command starts the Angular dev server and the Python backend together.
npx tsx scripts/examples/serve-example.ts --capability=rt-mafThe script runs uv sync in cockpit/runtimes/microsoft-agent-framework/python on the way, so the first start takes longer than later ones. Two processes appear in the output, one per half; stopping the script stops both.
Visit http://localhost:4330. The backend answers on http://localhost:5330/agent, with an unauthenticated health check at http://localhost:5330/ok.
The app opens with two welcome suggestions, and either one drives the whole loop in a single turn.
- Send File a team dinner expense, which submits "File a $220 team dinner expense from Blue Finch Bistro for the platform team offsite (6 attendees)." The agent delegates the policy research to a specialist through
research_policy— that call renders as a subagent card whose text streams while the child runs — and calls the server-sidelookup_expense_policytool. - Watch the side panel while the model is still writing the
submit_expensecall.predict_state_configmaps the tool'sexpenseargument onto a state key, so the vendor, category, amount, and memo fill in through realSTATE_DELTAevents before the tool has been invoked or approved. - The run then pauses. An approval card shows the amount, vendor, category, and memo above Cancel and Approve. Approve it and the agent confirms the submission in one sentence; cancel it and the agent acknowledges that nothing was filed.
- The second suggestion, File a monitor purchase, submits "File a $340 equipment expense from Pixel Peak Displays for a 27-inch monitor." and runs the same loop against the equipment policy.
Next steps
- How It Connects — the wire conventions this example relies on.
- Overview — what the integration does and does not support.