Skip to content

.NET: docs: Improve AsFunctionTool Disclaimers - #7854

Open
Mahdi Azarboon (azarboon) wants to merge 3 commits into
microsoft:mainfrom
azarboon:main
Open

.NET: docs: Improve AsFunctionTool Disclaimers#7854
Mahdi Azarboon (azarboon) wants to merge 3 commits into
microsoft:mainfrom
azarboon:main

Conversation

@azarboon

Copy link
Copy Markdown

Motivation & Context

I've created this new and improved PR based on Roger Barreto (@rogerbarreto)'s recommendation in #7803. The previous PR was becoming outdated and required frequent branch updates, so I created this one instead.

The content has already been vetted and revised, so it should be ready for review and merge.


Function tools are ideal for scenarios where determinism and predictability are critical, helping users avoid potential issues. This aspect is not currently documented on GitHub or Microsoft Learn. Since this example demonstrates a Function Tool, this update addresses that gap by highlighting potential use cases and benefits of this approach. The current example is simple and may cause users to underestimate the advantages of using Function Tools.

Description & Review Guide

This update is purely documentation and introduces no code changes. It adds content clarifying the use cases and potential benefits of Function Tools to guide users effectively.

Related Issue

Fixes #

Contribution Checklist

  • The code builds clean without any errors or warnings
  • All unit tests pass, and I have added new tests where possible
  • The PR follows the Contribution Guidelines
  • This PR is linked to an issue and there is no other open PR for this issue (see Related Issue above).
  • This is not a breaking change. If it is a breaking change, add the breaking change label (or add "[BREAKING]" to the title prefix, before or after any language prefix) — a workflow keeps the label and title prefix in sync automatically.

Copilot AI balanced review requested due to automatic review settings August 25, 2026 03:46
@agent-framework-automation agent-framework-automation Bot added documentation Usage: [Issues, PRs], Target: documentation in the code base and learn docs .NET Usage: [Issues, PRs], Target: .Net labels Aug 25, 2026
@github-actions github-actions Bot changed the title docs: Improve AsFunctionTool Disclaimers .NET: docs: Improve AsFunctionTool Disclaimers Aug 25, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Clarifies when to use agents exposed as function tools and their limitations.

Changes:

  • Describes function-tool composition scenarios.
  • Adds determinism and human-in-the-loop guidance.

💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.


This sample demonstrates how to use one agent as a function tool for another agent.

Function tools expose operations through structured inputs and outputs making them useful for many different integration scenarios.
Using `yourAIAgent.AsAIFunction()` exposes an agent as a function, enabling them to be used by other agents as tools allowing interesting agent composition scenarios.

> [!NOTE]
> Wrapping an AI Model driven agent exposed as an `AIFunction` doesn't make your agent deterministic, it will return the original agent output as the function result. The determinism of the result is completely dependent on how your agent is configured.

> [!IMPORTANT]
> Agents exposed through `.AsAIFunction()` are intended for background and non-interactive workflows, and are not suited for workflows that require human-in-the-loop approval.
> For interactive, human-in-the-loop workflows, use the [Microsoft.Agent.AI.Workflow](https://github.com/microsoft/agent-framework/tree/main/dotnet/samples/03-workflows) guidance.
@rogerbarreto

Copy link
Copy Markdown
Member

Mahdi Azarboon (@azarboon) This PR is a simple single doc file update, no new PR was necessary for this change, the PR updates are normally triggered by us automatically and resolved by git itself.

image

@rogerbarreto

Copy link
Copy Markdown
Member

Mahdi Azarboon (@azarboon) Please address the copilot review comments I think they are valid. Thanks

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Usage: [Issues, PRs], Target: documentation in the code base and learn docs .NET Usage: [Issues, PRs], Target: .Net

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants