Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion .workshop_instance/.workshop-state.json
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
{"current_step": 0, "schema_version": 1}
{
"current_step": 0,
"schema_version": 1
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
agent.manifest.yaml
agent.yaml
.env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
.venv
__pycache__
*.pyc
*.pyo
*.pyd
.Python
.env
Empty file.
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
FROM python:3.12-slim

WORKDIR /app

COPY . user_agent/
WORKDIR /app/user_agent

RUN if [ -f requirements.txt ]; then pip install -r requirements.txt; else echo "No requirements.txt found"; fi

EXPOSE 8088

CMD ["python", "main.py"]
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
You're now on step 01. The TravelBuddy agent files are present: `agent.yaml` and `agent.manifest.yaml` are ready to use, and you complete one small edit — write TravelBuddy's instructions in `main.py`. The `Dockerfile`, `.dockerignore`, and `.azdignore` that package and deploy the agent are also included (read-only) and explained in the Step 1 doc. The model you deployed in Step 0 is used at runtime via `AZURE_AI_MODEL_DEPLOYMENT_NAME`, so there's no model to provision here. Follow Step 1 in the root `README.md`.
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# travel_assistant/agent.manifest.yaml — AgentManifest: a parameterized template
# that deployment tooling (azd ai agent init / Foundry Toolkit) reads to scaffold
# your hosted agent. It has top-level metadata (name, description, tags), a
# `template` block (the hosted-agent definition), and a `resources` list.
# This file is provided ready to use — skim it so you know what it declares.
# Reference (each field explained):
# https://learn.microsoft.com/azure/foundry/agents/concepts/agent-yaml-reference
# NOTE: `name` (and `template.name` below) must be a hardcoded literal here — do
# NOT use ${VAR} or {{VAR}}. `azd ai agent init` reads and validates the agent
# name as-is, BEFORE any substitution: it never expands ${VAR} (those resolve later
# at deploy/run from .env / Bicep outputs) and only substitutes {{VAR}} for values
# declared under a `parameters:` block, which happens AFTER the name is validated.
# The validator rejects `$`, `{`, and `}`, so a placeholder here fails with
# "invalid agent name". The runtime-configurable prefix still lives in agent.yaml's
# `name` and in the WORKSHOP_RESOURCE_PREFIX environment variable below.
name: travel-buddy
description: >
A basic Agent Framework travel assistant hosted by Foundry.
metadata:
tags:
- Agent Framework
- AI Agent Hosting
- Azure AI AgentServer
- Responses Protocol
- Travel Assistant
template:
name: travel-buddy
kind: hosted
protocols:
- protocol: responses
version: 2.0.0
environment_variables:
- name: AZURE_AI_PROJECT_ENDPOINT
value: ${AZURE_AI_PROJECT_ENDPOINT}
- name: AZURE_AI_MODEL_DEPLOYMENT_NAME
value: ${AZURE_AI_MODEL_DEPLOYMENT_NAME}
- name: WORKSHOP_RESOURCE_PREFIX
value: ${WORKSHOP_RESOURCE_PREFIX}
# No provisioned resources: you already deployed a model in setup (Step 0), and the
# agent selects it at runtime through the AZURE_AI_MODEL_DEPLOYMENT_NAME env var
# above — so we don't declare a `kind: model` resource for azd to create.
resources: []
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# travel_assistant/agent.yaml — AgentDefinition (kind: hosted): the concrete
# runtime definition for your agent. It names the hosted agent, declares the
# `responses` protocol, sets a small CPU/memory shape, and lists the environment
# variables the container needs. This file is ready to run as-is — skim it so you
# understand each block. Reference:
# https://learn.microsoft.com/azure/foundry/agents/concepts/agent-yaml-reference
# yaml-language-server: $schema=https://raw.githubusercontent.com/microsoft/AgentSchema/refs/heads/main/schemas/v1.0/ContainerAgent.yaml
kind: hosted
name: ${WORKSHOP_RESOURCE_PREFIX}-travel-buddy
protocols:
- protocol: responses
version: 2.0.0
resources:
cpu: "0.25"
memory: "0.5Gi"
environment_variables:
# These values come from your .env at run/deploy time — keep the ${...} refs as-is.
- name: AZURE_AI_PROJECT_ENDPOINT
value: ${AZURE_AI_PROJECT_ENDPOINT}
- name: AZURE_AI_MODEL_DEPLOYMENT_NAME
value: ${AZURE_AI_MODEL_DEPLOYMENT_NAME}
# WORKSHOP_RESOURCE_PREFIX keeps your agent's name unique so it doesn't collide
# with other attendees deploying into a shared project.
- name: WORKSHOP_RESOURCE_PREFIX
value: ${WORKSHOP_RESOURCE_PREFIX}
38 changes: 38 additions & 0 deletions .workshop_instance/workshop_backups/reset-20260818184435/main.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# travel_assistant/main.py — Python entry point that hosts TravelBuddy: it creates
# the Foundry model client, defines the agent, and starts the Responses server.
# Complete the one TODO inside main() below.
import os

from agent_framework import Agent
from agent_framework.foundry import FoundryChatClient
from agent_framework_foundry_hosting import ResponsesHostServer
from azure.identity import DefaultAzureCredential
from dotenv import load_dotenv

load_dotenv(override=True)


def main() -> None:
# Foundry model client, built from your .env settings.
client = FoundryChatClient(
project_endpoint=os.environ["AZURE_AI_PROJECT_ENDPOINT"],
model=os.environ["AZURE_AI_MODEL_DEPLOYMENT_NAME"],
credential=DefaultAzureCredential(),
)

# TODO: write TravelBuddy's system instructions. Describe a friendly travel
# assistant that gives practical, concise trip-planning advice — local context,
# budget awareness, and safety-minded tips.
agent = Agent(
client=client,
name="travel-buddy",
instructions="TODO: write TravelBuddy's system instructions here.",
# History is managed by the hosting infrastructure, so don't store it server-side.
default_options={"store": False},
)

ResponsesHostServer(agent).run()


if __name__ == "__main__":
main()
Loading