-
Notifications
You must be signed in to change notification settings - Fork 268
update hosted agent samples #445
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
update hosted agent samples #445
Conversation
Corrected the phrasing for registering the subscription with the preview feature in Azure Portal.
| await AgentServerApplication.RunAsync(new ApplicationOptions( | ||
| ConfigureServices: services => services.AddSingleton<IAgentInvocation, SystemUtilityAgentInvocation>(), | ||
| TelemetrySourceName: "SystemUtilityAgent" | ||
| )).ConfigureAwait(false); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Currently the .NET version of adapter sample usage is like:
var agent = new ChatClientAgent(chatClient,
name: "AgentWithHostedMCP",
instructions: @"You are a helpful assistant with access to tools for fetching Microsoft documentation.
IMPORTANT: When the user asks about Microsoft Learn articles or documentation:
1. You MUST use the microsoft_docs_fetch tool to retrieve the actual content
2. Do NOT rely on your training data
3. Always fetch the latest information from the provided URL
Available tools:
- microsoft_docs_fetch: Fetches and converts Microsoft Learn documentation
- microsoft_docs_search: Searches Microsoft/Azure documentation
- microsoft_code_sample_search: Searches for code examples")
.AsBuilder()
.UseFoundryTools(FoundryConnectedTool.Mcp(toolConnectionId))
.UseOpenTelemetry(sourceName: "Agents", configure: (cfg) => cfg.EnableSensitiveData = true)
.Build();
// Run agent with tool support using ToolDefinition objects
await agent.RunAIAgentAsync(telemetrySourceName: "Agents");Is SystemUtilityAgentInvocation an existing built-in AgentInvocation, or do I need to implement it myself? I was trying running this sample locally, but I couldn’t find SystemUtilityAgentInvocation in the codebase ('SystemUtilityAgentInvocation' could not be found).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is customer agent implementation. see here: https://github.com/melionel/foundry-samples/blob/mengla/add_more_samples/samples/csharp/hosted-agents/AgentWithCustomFramework/SystemUtilityAgent/SystemUtilityAgentInvocation.cs
Corrected the phrasing for registering the subscription with the preview feature in Azure Portal.