microsoft / microsoft/agent-framework

.NET: Consider improving the discoverability of required functions

Open
#793 0 comments 0 reactions 1 assignee View on GitHub

@westey-m is already working on this.

Since Sep 17, 2025.

.NET
Dominant language
Python
Stars
13.6k
Forks
2.3k
Avg merge
2d 45m
Merged PRs (30d)
358

Description

Currently the code looks like this

```csharp
// Create the chat client and agent.
// Note that we are wrapping the function tool with ApprovalRequiredAIFunction to require user approval before invoking it.
AIAgent agent = new AzureOpenAIClient(
new Uri(endpoint),
new AzureCliCredential())
.GetChatClient(deploymentName)
.CreateAIAgent(instructions: "You are a helpful assistant", tools: [new ApprovalRequiredAIFunction(AIFunctionFactory.Create(GetWeather))]);
```

Consider add an extension method e.g. `AsRequiredFunction()` so developers can more easily discover this

`AIFunctionFactory.Create(GetWeather).AsRequiredFunction()`

Or add a new method to `AIFunctionFactory`

`AIFunctionFactory.CreateRequiredFunction(GetWeather)`

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.