Skip to content

Conversation

crickman
Copy link
Contributor

@crickman crickman commented Oct 13, 2025

Motivation and Context

Enable function calling for declarative workflows (when an agent within the workflow has a function tool).

Description

  • An agent that defines a function will either have that function auto-executed (if available) or else a request is made to the caller via AgentToolRequest. The caller may then respond with AgentToolResponse.

  • Integration tests add for both auto-execute and caller-requested modes.

  • Sample updated

Contribution Checklist

  • The code builds clean without any errors or warnings
  • The PR follows the Contribution Guidelines
  • All unit tests pass, and I have added new tests where possible
  • Is this a breaking change? If yes, add "[BREAKING]" prefix to the title of the PR.

@crickman crickman self-assigned this Oct 13, 2025
@Copilot Copilot AI review requested due to automatic review settings October 13, 2025 22:03
@crickman crickman added enhancement New feature or request .NET workflows Related to Workflows in agent-framework labels Oct 13, 2025
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR enables function calling capabilities for declarative workflow agents, allowing agents to either auto-execute functions when available or request function execution from the caller through a tool request/response mechanism.

  • Added agent-level function invocation support with auto-execute and caller-requested modes
  • Implemented new tool request/response event system for function calls
  • Added comprehensive integration tests for both execution modes

Reviewed Changes

Copilot reviewed 14 out of 14 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
ToolInputWorkflowTest.cs New integration test class validating both auto-invoke and request-invoke function execution modes
FunctionTool.yaml Test workflow configuration that invokes agents with function tools multiple times
MenuPlugin.cs Test plugin providing menu-related functions for integration testing
ToolAgent.yaml Agent configuration defining menu-related function tools
InvokeAzureAgentExecutor.cs Enhanced executor to handle function calls and tool request/response workflow
WorkflowActionVisitor.cs Updated to support the new multi-step agent invocation pattern with tool handling
WorkflowAgentProvider.cs Added properties for function configuration and concurrent invocation settings
AzureAgentProvider.cs Enhanced to configure function invocation capabilities on chat client agents
AgentToolRequest.cs/AgentToolResponse.cs New event classes for function call request/response communication
ChatMessageExtensions.cs Added extension method to convert function results to chat messages
WorkflowHarness.cs Updated test harness to support tool request/response scenarios and improved logging
IntegrationTest.cs Modified to accept function tools for agent configuration
AgentFactory.cs Added new tool agent configuration and menu plugin registration

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@crickman crickman added this pull request to the merge queue Oct 14, 2025
Merged via the queue into main with commit a6b6937 Oct 14, 2025
20 checks passed
@crickman crickman deleted the crickman/workflows-declarative-agent-toolcall branch October 14, 2025 20:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request .NET workflows Related to Workflows in agent-framework

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants