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 @@ -62,19 +62,13 @@
Console.WriteLine($"Connecting to Foundry Toolbox '{toolboxName}' MCP server...");

// Connect to the Foundry Toolbox MCP endpoint.
// The Foundry-Features: Toolboxes=V1Preview opt-in header is required while the
// toolbox MCP surface is in preview.
await using var mcpClient = await McpClient.CreateAsync(
new HttpClientTransport(
new HttpClientTransportOptions
{
Endpoint = new Uri(toolboxMcpServerUrl),
Name = toolboxName,
TransportMode = HttpTransportMode.StreamableHttp,
AdditionalHeaders = new Dictionary<string, string>
{
["Foundry-Features"] = "Toolboxes=V1Preview",
},
},
httpClient));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@ namespace BrowserAutomation;
/// </summary>
public class ToolboxClient
{
private const string ToolboxFeatures = "Toolboxes=V1Preview";

private readonly string _endpoint;
private readonly Func<string> _getToken;
private readonly ILogger _logger;
Expand Down Expand Up @@ -152,7 +150,6 @@ private async Task<HttpResponseMessage> PostAsync(HttpClient client, object body
Content = new StringContent(json, System.Text.Encoding.UTF8, "application/json"),
};
request.Headers.Authorization = new AuthenticationHeaderValue("Bearer", _getToken());
request.Headers.TryAddWithoutValidation("Foundry-Features", ToolboxFeatures);
if (_sessionId != null)
request.Headers.TryAddWithoutValidation("mcp-session-id", _sessionId);

Expand Down
5 changes: 5 additions & 0 deletions samples/python/hosted-agents/agent-framework/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@

This directory contains samples that demonstrate how to use the [Agent Framework](https://github.com/microsoft/agent-framework) to host agents with different capabilities and configurations. Each sample includes a README with instructions on how to set up, run, and interact with the agent.

> [!IMPORTANT]
> **Migrating from Protocol version 1.0.0 to 2.0.0:** The Foundry Hosted Agents service has been updated to use Protocol version 2.0.0. If your application is using Protocol version 1.0.0, upgrade to Protocol version 2.0.0 in your `agent.manifest.yaml` or `agent.yaml` and upgrade to the latest `agent-framework-foundry-hosting` package. `agent-framework-foundry-hosting==1.0.0a260625` is the last version that supports Protocol version 1.0.0.
>
> The `agent-framework-foundry-hosting` Python API surface is intended to remain stable, but protocol 1.0.0 and 2.0.0 are incompatible.

## Samples

### Responses API
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ template:
kind: hosted
protocols:
- protocol: invocations
version: 1.0.0
version: 2.0.0
environment_variables:
- name: AZURE_AI_MODEL_DEPLOYMENT_NAME
value: "{{AZURE_AI_MODEL_DEPLOYMENT_NAME}}"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ kind: hosted
name: agent-framework-agent-basic-invocations
protocols:
- protocol: invocations
version: 1.0.0
version: 2.0.0
resources:
cpu: '0.25'
memory: '0.5Gi'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
agent-framework-foundry
agent-framework-foundry-hosting
agent-framework-foundry-hosting>=1.0.0a260630

# debugpy enables local debugging of this agent with the Foundry Toolkit VS Code extension.
debugpy
debugpy
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ template:
kind: hosted
protocols:
- protocol: responses
version: 1.0.0
version: 2.0.0
environment_variables:
- name: AZURE_AI_MODEL_DEPLOYMENT_NAME
value: "{{AZURE_AI_MODEL_DEPLOYMENT_NAME}}"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ kind: hosted
name: agent-framework-agent-basic-responses
protocols:
- protocol: responses
version: 1.0.0
version: 2.0.0
resources:
cpu: '0.25'
memory: '0.5Gi'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# Use the narrow Foundry subpackages to keep dependencies light.
agent-framework-foundry
agent-framework-foundry-hosting
mcp<2,>=1.24.0
agent-framework-foundry-hosting>=1.0.0a260630

# debugpy enables local debugging of this agent with the Foundry Toolkit VS Code extension.
debugpy
debugpy
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ template:
kind: hosted
protocols:
- protocol: responses
version: 1.0.0
version: 2.0.0
environment_variables:
- name: AZURE_AI_MODEL_DEPLOYMENT_NAME
value: "{{AZURE_AI_MODEL_DEPLOYMENT_NAME}}"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ kind: hosted
name: agent-framework-agent-with-local-tools-responses
protocols:
- protocol: responses
version: 1.0.0
version: 2.0.0
resources:
cpu: "0.25"
memory: 0.5Gi
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# Use the narrow Foundry subpackages to keep dependencies light.
agent-framework-foundry
agent-framework-foundry-hosting
mcp<2,>=1.24.0
agent-framework-foundry-hosting>=1.0.0a260630

# debugpy enables local debugging of this agent with the Foundry Toolkit VS Code extension.
debugpy
debugpy
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ template:
kind: hosted
protocols:
- protocol: responses
version: 1.0.0
version: 2.0.0
environment_variables:
- name: AZURE_AI_MODEL_DEPLOYMENT_NAME
value: "{{AZURE_AI_MODEL_DEPLOYMENT_NAME}}"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ kind: hosted
name: agent-framework-agent-with-remote-mcp-tools-responses
protocols:
- protocol: responses
version: 1.0.0
version: 2.0.0
resources:
cpu: "0.25"
memory: 0.5Gi
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# Use the narrow Foundry subpackages to keep dependencies light.
agent-framework-foundry
agent-framework-foundry-hosting
mcp<2,>=1.24.0
agent-framework-foundry-hosting>=1.0.0a260630

# debugpy enables local debugging of this agent with the Foundry Toolkit VS Code extension.
debugpy
debugpy
Loading
Loading