Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
1bbd91e
Fix ChatHistory storage by service table (#826)
westey-m Jan 22, 2026
f99085e
Rename ChatMessageStore to ChatHistoryProvider (#829)
westey-m Jan 27, 2026
d3a166c
Added page for GitHub Copilot SDK (#828)
dmytrostruk Jan 27, 2026
4b89a47
updated filtering section (#827)
eavanvalkenburg Jan 27, 2026
8e82442
Merge pull request #831 from MicrosoftDocs/main
dmytrostruk Jan 27, 2026
318feb4
Add an overview page for all integrations (#832)
westey-m Jan 28, 2026
e820d9b
Rename AgentThread to AgentSession (#830)
westey-m Jan 28, 2026
838a78c
update to AIFunction to FunctionTool
eavanvalkenburg Jan 28, 2026
6ca9a53
Merge pull request #834 from MicrosoftDocs/main
westey-m Jan 28, 2026
4e978e0
Renamed Github to GitHub
dmytrostruk Jan 28, 2026
4a73fdb
Merge pull request #835 from dmytrostruk/github-rename
dmytrostruk Jan 28, 2026
2e03bc3
Update magentic orchestration doc (#820)
TaoChenOSU Jan 28, 2026
48651c8
Merge pull request #833 from eavanvalkenburg/tool
dmytrostruk Jan 28, 2026
3a16c99
Added redirection URL for Purview
dmytrostruk Jan 28, 2026
0c42c70
Merge pull request #837 from dmytrostruk/fix-purview-link
dmytrostruk Jan 28, 2026
097d1f1
Fixed integrations link
dmytrostruk Jan 28, 2026
b0e93dc
Merge pull request #839 from dmytrostruk/fix-integrations-link
dmytrostruk Jan 28, 2026
d1f3b77
Merge pull request #840 from MicrosoftDocs/main
dmytrostruk Jan 28, 2026
d6aa37e
Added docs for Claude Agent SDK (#841)
dmytrostruk Jan 30, 2026
35ff4af
Merge pull request #843 from MicrosoftDocs/main
dmytrostruk Jan 30, 2026
de92d27
Merging changes synced from https://github.com/MicrosoftDocs/semantic…
Jan 30, 2026
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
10 changes: 10 additions & 0 deletions .openpublishing.redirection.json
Original file line number Diff line number Diff line change
Expand Up @@ -834,6 +834,16 @@
"source_path": "agent-framework/user-guide/agents/agent-observability.md",
"redirect_url": "/agent-framework/user-guide/observability",
"redirect_document_id": true
},
{
"source_path": "agent-framework/tutorials/plugins/use-purview-with-agent-framework-sdk.md",
"redirect_url": "/agent-framework/integrations/use-purview-with-agent-framework-sdk",
"redirect_document_id": true
},
{
"source_path": "agent-framework/integrations/index.md",
"redirect_url": "/agent-framework/integrations/overview",
"redirect_document_id": true
}
]
}
4 changes: 1 addition & 3 deletions agent-framework/TOC.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,7 @@ items:
- name: Observability
href: user-guide/observability.md
- name: Integrations
items:
- name: AG-UI
href: integrations/ag-ui/TOC.yml
href: integrations/TOC.yml
- name: Support
href: support/TOC.yml
- name: Migration Guide
Expand Down
6 changes: 6 additions & 0 deletions agent-framework/integrations/TOC.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
- name: Overview
href: overview.md
- name: AG-UI
href: ag-ui/TOC.yml
- name: Purview
href: use-purview-with-agent-framework-sdk.md
34 changes: 17 additions & 17 deletions agent-framework/integrations/ag-ui/backend-tool-rendering.md
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ To see tool calls and results in real-time, extend the client's streaming loop t

```csharp
// Inside the streaming loop from getting-started.md
await foreach (AgentResponseUpdate update in agent.RunStreamingAsync(messages, thread))
await foreach (AgentResponseUpdate update in agent.RunStreamingAsync(messages, session))
{
ChatResponseUpdate chatUpdate = update.AsChatResponseUpdate();

Expand Down Expand Up @@ -323,15 +323,15 @@ This approach provides:

### Basic Function Tool

You can turn any Python function into a tool using the `@ai_function` decorator:
You can turn any Python function into a tool using the `@tool` decorator:

```python
from typing import Annotated
from pydantic import Field
from agent_framework import ai_function
from agent_framework import tool


@ai_function
@tool
def get_weather(
location: Annotated[str, Field(description="The city")],
) -> str:
Expand All @@ -342,7 +342,7 @@ def get_weather(

### Key Concepts

- **`@ai_function` decorator**: Marks a function as available to the agent
- **`@tool` decorator**: Marks a function as available to the agent
- **Type annotations**: Provide type information for parameters
- **`Annotated` and `Field`**: Add descriptions to help the agent understand parameters
- **Docstring**: Describes what the function does (helps the agent decide when to use it)
Expand All @@ -354,18 +354,18 @@ You can provide multiple tools to give the agent more capabilities:

```python
from typing import Any
from agent_framework import ai_function
from agent_framework import tool


@ai_function
@tool
def get_weather(
location: Annotated[str, Field(description="The city.")],
) -> str:
"""Get the current weather for a location."""
return f"The weather in {location} is sunny with a temperature of 22°C."


@ai_function
@tool
def get_forecast(
location: Annotated[str, Field(description="The city.")],
days: Annotated[int, Field(description="Number of days to forecast")] = 3,
Expand All @@ -392,7 +392,7 @@ Here's a complete server implementation with function tools:
import os
from typing import Annotated, Any

from agent_framework import ChatAgent, ai_function
from agent_framework import ChatAgent, tool
from agent_framework.azure import AzureOpenAIChatClient
from agent_framework_ag_ui import add_agent_framework_fastapi_endpoint
from azure.identity import AzureCliCredential
Expand All @@ -401,7 +401,7 @@ from pydantic import Field


# Define function tools
@ai_function
@tool
def get_weather(
location: Annotated[str, Field(description="The city")],
) -> str:
Expand All @@ -410,7 +410,7 @@ def get_weather(
return f"The weather in {location} is sunny with a temperature of 22°C."


@ai_function
@tool
def search_restaurants(
location: Annotated[str, Field(description="The city to search in")],
cuisine: Annotated[str, Field(description="Type of cuisine")] = "any",
Expand Down Expand Up @@ -588,7 +588,7 @@ outdoor dining!
Handle errors gracefully in your tools:

```python
@ai_function
@tool
def get_weather(
location: Annotated[str, Field(description="The city.")],
) -> str:
Expand All @@ -606,7 +606,7 @@ def get_weather(
Return structured data when appropriate:

```python
@ai_function
@tool
def analyze_sentiment(
text: Annotated[str, Field(description="The text to analyze")],
) -> dict[str, Any]:
Expand All @@ -629,7 +629,7 @@ def analyze_sentiment(
Provide clear descriptions to help the agent understand when to use tools:

```python
@ai_function
@tool
def book_flight(
origin: Annotated[str, Field(description="Departure city and airport code, e.g., 'New York, JFK'")],
destination: Annotated[str, Field(description="Arrival city and airport code, e.g., 'London, LHR'")],
Expand All @@ -651,7 +651,7 @@ def book_flight(
For related tools, organize them in a class:

```python
from agent_framework import ai_function
from agent_framework import tool


class WeatherTools:
Expand All @@ -660,7 +660,7 @@ class WeatherTools:
def __init__(self, api_key: str):
self.api_key = api_key

@ai_function
@tool
def get_current_weather(
self,
location: Annotated[str, Field(description="The city.")],
Expand All @@ -669,7 +669,7 @@ class WeatherTools:
# Use self.api_key to call API
return f"Current weather in {location}: Sunny, 22°C"

@ai_function
@tool
def get_forecast(
self,
location: Annotated[str, Field(description="The city.")],
Expand Down
4 changes: 2 additions & 2 deletions agent-framework/integrations/ag-ui/frontend-tools.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ AIAgent inspectableAgent = baseAgent

static async IAsyncEnumerable<AgentResponseUpdate> InspectToolsMiddleware(
IEnumerable<ChatMessage> messages,
AgentThread? thread,
AgentSession? session,
AgentRunOptions? options,
AIAgent innerAgent,
CancellationToken cancellationToken)
Expand All @@ -109,7 +109,7 @@ static async IAsyncEnumerable<AgentResponseUpdate> InspectToolsMiddleware(
}
}

await foreach (AgentResponseUpdate update in innerAgent.RunStreamingAsync(messages, thread, options, cancellationToken))
await foreach (AgentResponseUpdate update in innerAgent.RunStreamingAsync(messages, session, options, cancellationToken))
{
yield return update;
}
Expand Down
6 changes: 3 additions & 3 deletions agent-framework/integrations/ag-ui/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ AIAgent agent = chatClient.AsAIAgent(
name: "agui-client",
description: "AG-UI Client Agent");

AgentThread thread = await agent.GetNewThreadAsync();
AgentSession session = await agent.GetNewSessionAsync();
List<ChatMessage> messages =
[
new(ChatRole.System, "You are a helpful assistant.")
Expand Down Expand Up @@ -209,7 +209,7 @@ try
bool isFirstUpdate = true;
string? threadId = null;

await foreach (AgentResponseUpdate update in agent.RunStreamingAsync(messages, thread))
await foreach (AgentResponseUpdate update in agent.RunStreamingAsync(messages, session))
{
ChatResponseUpdate chatUpdate = update.AsChatResponseUpdate();

Expand Down Expand Up @@ -259,7 +259,7 @@ catch (Exception ex)
- **AsAIAgent**: Extension method on `AGUIChatClient` to create an agent from the client
- **RunStreamingAsync**: Streams responses as `AgentResponseUpdate` objects
- **AsChatResponseUpdate**: Extension method to access chat-specific properties like `ConversationId` and `ResponseId`
- **Thread Management**: The `AgentThread` maintains conversation context across requests
- **Session Management**: The `AgentSession` maintains conversation context across requests
- **Content Types**: Responses include `TextContent` for messages and `ErrorContent` for errors

### Configure and Run the Client
Expand Down
Loading