Skip to content
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ A minimal getting-started agent implementing the [AG-UI protocol](https://docs.a

### Prerequisites

- Python 3.10+
- Python 3.12+
- A Foundry project with a deployed model

### Run the agent locally
Expand Down Expand Up @@ -101,17 +101,15 @@ azd ai agent monitor

### Set up the Python virtual environment

- Open the Command Palette (`Ctrl+Shift+P`) and run **Python: Create Environment...** to create a virtual environment in the workspace (or **Python: Select Interpreter** to use an existing one).
- Install dependencies in the virtual environment:
- With Python 3.12 or later and [pipx](https://pipx.pypa.io/stable/installation/), install uv outside the project environment, then let uv create and synchronize the locked environment:

```bash
# use uv to accelerate
pip install uv
uv pip install -r requirements.txt
cd src/ag-ui-invocations

# or pure pip
pip install -r requirements.txt
pipx install uv==0.11.7
uv sync --frozen --python 3.12
Comment thread
antriksh30 marked this conversation as resolved.
```
- Open the Command Palette (`Ctrl+Shift+P`), run **Python: Select Interpreter**, and select `src/ag-ui-invocations/.venv`.

### Run and debug the agent

Expand All @@ -120,7 +118,7 @@ Press **F5** to start the agent. The agent starts and the **Agent Inspector** op
### Or run manually, then open the Inspector

1. Set the required environment variables and sign in to Azure with the Azure CLI (`az login`).
2. Start the agent: `python main.py` (listens on `http://localhost:8088`).
2. From `src/ag-ui-invocations`, start the agent: `uv run --no-sync python main.py` (listens on `http://localhost:8088`).
3. Command Palette (`Ctrl+Shift+P`) → **Foundry Toolkit: Open Agent Inspector**, then send a message to test.

### Deploy to Foundry
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
FROM ghcr.io/astral-sh/uv:0.11.7 AS uv
FROM python:3.12-slim
WORKDIR /app
COPY . user_agent/

COPY --from=uv /uv /uvx /bin/

WORKDIR /app/user_agent
RUN if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
COPY pyproject.toml uv.lock uv.toml ./
RUN uv sync --frozen --no-dev --no-install-project

COPY . .

EXPOSE 8088

# Precompile Python bytecode at build time so cold starts don't pay for it.
Expand All @@ -15,7 +21,7 @@ EXPOSE 8088
# container start.
# PYTHONDONTWRITEBYTECODE is cleared for these commands only: it blocks
# bytecode *writes*, not *reads*, so images that set it still benefit.
RUN PYTHONDONTWRITEBYTECODE= python -m compileall -q $(python -c "import sysconfig as s; print(s.get_paths()['stdlib'], s.get_paths()['purelib'])") || true; \
PYTHONDONTWRITEBYTECODE= python -m compileall -q .
RUN PYTHONDONTWRITEBYTECODE= .venv/bin/python -m compileall -q $(.venv/bin/python -c "import sysconfig as s; print(s.get_paths()['stdlib'], s.get_paths()['purelib'])") || true; \
PYTHONDONTWRITEBYTECODE= .venv/bin/python -m compileall -q -x '[.]venv' .

CMD ["python", "main.py"]
CMD ["/app/user_agent/.venv/bin/python", "main.py"]
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
[project]
name = "ag-ui-invocations"
version = "0.1.0"
description = "A Microsoft Foundry hosted agent using the Invocations protocol."
requires-python = ">=3.12"
dependencies = [
"ag-ui-protocol==0.1.16",
"azure-ai-agentserver-invocations==1.1.0",
"azure-identity==1.25.3",
"debugpy",
"openai==2.32.0",
"pydantic-ai-slim[openai]==1.75.0",
]

This file was deleted.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
system-certs = true
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ This sample is configured for **Microsoft Foundry** mode by default

### Prerequisites

- Python 3.10+
- Python 3.12+
- `az login`
- A Foundry resource with Claude model deployments

Expand Down Expand Up @@ -70,17 +70,15 @@ azd deploy

### Set up the Python virtual environment

- Open the Command Palette (`Ctrl+Shift+P`) and run **Python: Create Environment...** to create a virtual environment in the workspace (or **Python: Select Interpreter** to use an existing one).
- Install dependencies in the virtual environment:
- With Python 3.12 or later and [pipx](https://pipx.pypa.io/stable/installation/), install uv outside the project environment, then let uv create and synchronize the locked environment:

```bash
# use uv to accelerate
pip install uv
uv pip install -r requirements.txt
cd src/claude-agent-sdk-invocations

# or pure pip
pip install -r requirements.txt
pipx install uv==0.11.7
uv sync --frozen --python 3.12
Comment thread
antriksh30 marked this conversation as resolved.
```
- Open the Command Palette (`Ctrl+Shift+P`), run **Python: Select Interpreter**, and select `src/claude-agent-sdk-invocations/.venv`.

### Run and debug the agent

Expand All @@ -89,7 +87,7 @@ Press **F5** to start the agent. The agent starts and the **Agent Inspector** op
### Or run manually, then open the Inspector

1. Set the required environment variables and sign in to Azure with the Azure CLI (`az login`).
2. Start the agent: `python main.py` (listens on `http://localhost:8088`).
2. From `src/claude-agent-sdk-invocations`, start the agent: `uv run --no-sync python main.py` (listens on `http://localhost:8088`).
3. Command Palette (`Ctrl+Shift+P`) → **Foundry Toolkit: Open Agent Inspector**, then send a message to test.

### Deploy to Foundry
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,13 @@
FROM ghcr.io/astral-sh/uv:0.11.7 AS uv
FROM python:3.12-slim

WORKDIR /app
COPY --from=uv /uv /uvx /bin/

COPY . user_agent/
WORKDIR /app/user_agent
COPY pyproject.toml uv.lock uv.toml ./
RUN uv sync --frozen --no-dev --no-install-project

RUN pip install --no-input --upgrade pip && \
if [ -f requirements.txt ]; then \
pip install --no-input -r requirements.txt; \
else \
echo "No requirements.txt found"; \
fi
COPY . .

EXPOSE 8088

Expand All @@ -24,7 +21,7 @@ EXPOSE 8088
# container start.
# PYTHONDONTWRITEBYTECODE is cleared for these commands only: it blocks
# bytecode *writes*, not *reads*, so images that set it still benefit.
RUN PYTHONDONTWRITEBYTECODE= python -m compileall -q $(python -c "import sysconfig as s; print(s.get_paths()['stdlib'], s.get_paths()['purelib'])") || true; \
PYTHONDONTWRITEBYTECODE= python -m compileall -q .
RUN PYTHONDONTWRITEBYTECODE= .venv/bin/python -m compileall -q $(.venv/bin/python -c "import sysconfig as s; print(s.get_paths()['stdlib'], s.get_paths()['purelib'])") || true; \
PYTHONDONTWRITEBYTECODE= .venv/bin/python -m compileall -q -x '[.]venv' .

CMD ["python", "main.py"]
CMD ["/app/user_agent/.venv/bin/python", "main.py"]
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[project]
name = "claude-agent-sdk-invocations"
version = "0.1.0"
description = "A Microsoft Foundry hosted agent using the Invocations protocol."
requires-python = ">=3.12"
dependencies = [
"azure-ai-agentserver-invocations==1.1.0",
"claude-agent-sdk>=0.1.74",
"debugpy",
"httpx<1.0",
]

This file was deleted.

Loading
Loading