Commit fdc6e68
.Net: Semantic Kernel -> Agent Framework - Migration/Samples Update (AF 1.0 Compatible) (#13852)
## Description
Updates the SK → Agent Framework migration document, samples, and bridge
code from AF preview (`1.0.0-preview.251009.1`) to GA (`1.0.0`).
### Breaking changes addressed
| Preview API | AF 1.0 GA | Scope |
|---|---|---|
| `AgentThread` | `AgentSession` | Core type rename |
| `GetNewThread()` | `CreateSessionAsync()` | Now async |
| `AgentRunResponse` | `AgentResponse` | Return type rename |
| `AgentRunResponseUpdate` | `AgentResponseUpdate` | Streaming type
rename |
| `CreateAIAgent()` | `AsAIAgent()` | Extension method rename |
| `AssistantClient.CreateAIAgentAsync()` | **Removed** | Redirect to
Responses API |
| `PersistentAgentsClient` | **Obsolete** | Use `AIProjectClient` via
`Microsoft.Agents.AI.Foundry` |
| `Microsoft.Agents.AI.AzureAI` | `Microsoft.Agents.AI.Foundry` |
Package rename |
| `InProcessExecution.StreamAsync` | `RunStreamingAsync` | Workflow API
|
| `AgentRunUpdateEvent` | `AgentResponseUpdateEvent` | Workflow event |
| `AIAgent.Id` (virtual) | `IdCore` (protected virtual) | Override
pattern |
### Additional discoveries
- `using OpenAI.Chat;` required for `ChatClient.AsAIAgent()` extension
to resolve
- `using OpenAI.Responses;` required for `ResponsesClient.AsAIAgent()`
extension to resolve
### What changed
**Package versions** (`dotnet/Directory.Packages.props`)
- AF packages updated to `1.0.0`
- `Microsoft.Agents.AI.AzureAI` → `Microsoft.Agents.AI.Foundry`
**Bridge code** (`dotnet/src/Agents/Abstractions/AIAgent/`)
- `SemanticKernelAIAgent.cs`: New `Core` method overrides
(`CreateSessionCoreAsync`, `RunCoreAsync`, etc.)
- `SemanticKernelAIAgentThread` → `SemanticKernelAIAgentSession`
(extends `AgentSession`)
**31 migration samples** (all compile ✅)
- OpenAI/AzureOpenAI: `AsAIAgent`, `CreateSessionAsync`, `using
OpenAI.Chat;`
- Assistants (8): AF sections rewritten to Responses API
- Responses (8): Direct `ResponsesClient.AsAIAgent()`
- Foundry (4): `AIProjectClient.AsAIAgent()` via
`Microsoft.Agents.AI.Foundry`
- Orchestrations (3): `RunStreamingAsync`, `AgentResponseUpdateEvent`
**Migration document**
(`.github/upgrades/prompts/SemanticKernelToAgentFramework.md`)
- All AF preview API references updated to 1.0 GA patterns
**Unit/integration tests** (~15 files)
- Mechanical renames for `AgentSession`, `AgentResponse`,
`CreateSessionAsync`
### Validation
8 standalone console programs were created and executed against AF 1.0.0
NuGet packages with real API keys, validating all migration patterns
end-to-end:
1. OpenAI Basics (ChatClient → AsAIAgent, CreateSessionAsync,
Run/RunStreaming)
2. OpenAI ToolCall (AIFunctionFactory.Create, tool invocation)
3. OpenAI DI (ServiceProvider registration)
4. OpenAI Responses (ResponsesClient.AsAIAgent)
5. Azure AI Foundry (AIProjectClient.AsAIAgent)
6. Workflows Handoff (HandoffWorkflowBuilder,
InProcessExecution.RunStreamingAsync)
7. Session Lifecycle (Create, Serialize, Deserialize, multi-turn)
8. Assistants Migration Path (Responses API as replacement)
---------
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>1 parent 3f0e2d5 commit fdc6e68
63 files changed
Lines changed: 497 additions & 1960 deletions
File tree
- .github/upgrades/prompts
- dotnet
- samples/AgentFrameworkMigration
- AgentOrchestrations
- Step01_Concurrent
- Step02_Sequential
- Step03_Handoff
- AzureAIFoundry
- Step01_Basics
- Step02_ToolCall
- Step03_DependencyInjection
- Step04_CodeInterpreter
- AzureOpenAIAssistants
- Step01_Basics
- Step02_ToolCall
- Step03_DependencyInjection
- Step04_CodeInterpreter
- AzureOpenAIResponses
- Step01_Basics
- Step02_ReasoningModel
- Step03_ToolCall
- Step04_DependencyInjection
- AzureOpenAI
- Step01_Basics
- Step02_ToolCall
- Step03_DependencyInjection
- Step04_ToolCall_WithOpenAPI
- OpenAIAssistants
- Step01_Basics
- Step02_ToolCall
- Step03_DependencyInjection
- Step04_CodeInterpreter
- OpenAIResponses
- Step01_Basics
- Step02_ReasoningModel
- Step03_ToolCall
- Step04_DependencyInjection
- OpenAI
- Step01_Basics
- Step02_ToolCall
- Step03_DependencyInjection
- src
- Agents
- Abstractions/AIAgent
- UnitTests
- A2A
- AIAgent
- AzureAI
- Bedrock/Extensions.cs
- Copilot
- Core
- OpenAI
- Connectors
- Connectors.AzureOpenAI.UnitTests/KernelCore
- Connectors.OpenAI.UnitTests/KernelCore
- IntegrationTests/Agents/CommonInterfaceConformance/SemanticKernelAIAgentConformance
- SemanticKernel.Abstractions/AI
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 82 additions & 78 deletions
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
50 | 50 | | |
51 | 51 | | |
52 | 52 | | |
53 | | - | |
54 | | - | |
55 | | - | |
56 | | - | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
57 | 57 | | |
58 | 58 | | |
59 | 59 | | |
| |||
136 | 136 | | |
137 | 137 | | |
138 | 138 | | |
139 | | - | |
| 139 | + | |
140 | 140 | | |
141 | 141 | | |
142 | 142 | | |
| |||
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
14 | | - | |
| 14 | + | |
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
| |||
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
79 | 79 | | |
80 | 80 | | |
81 | 81 | | |
82 | | - | |
| 82 | + | |
83 | 83 | | |
84 | 84 | | |
85 | 85 | | |
86 | 86 | | |
87 | 87 | | |
88 | | - | |
| 88 | + | |
89 | 89 | | |
90 | 90 | | |
91 | 91 | | |
| |||
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
14 | | - | |
| 14 | + | |
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
| |||
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
82 | 82 | | |
83 | 83 | | |
84 | 84 | | |
85 | | - | |
| 85 | + | |
86 | 86 | | |
87 | 87 | | |
88 | 88 | | |
89 | 89 | | |
90 | 90 | | |
91 | | - | |
| 91 | + | |
92 | 92 | | |
93 | 93 | | |
94 | 94 | | |
| |||
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
14 | | - | |
| 14 | + | |
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
| |||
Lines changed: 4 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
| 3 | + | |
| 4 | + | |
3 | 5 | | |
4 | 6 | | |
5 | 7 | | |
| |||
207 | 209 | | |
208 | 210 | | |
209 | 211 | | |
210 | | - | |
| 212 | + | |
211 | 213 | | |
212 | 214 | | |
213 | 215 | | |
214 | 216 | | |
215 | 217 | | |
216 | | - | |
| 218 | + | |
217 | 219 | | |
218 | 220 | | |
219 | 221 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
14 | | - | |
| 14 | + | |
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
| |||
Lines changed: 12 additions & 17 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
| 4 | + | |
4 | 5 | | |
5 | 6 | | |
6 | 7 | | |
| |||
67 | 68 | | |
68 | 69 | | |
69 | 70 | | |
70 | | - | |
| 71 | + | |
71 | 72 | | |
72 | 73 | | |
73 | 74 | | |
| |||
80 | 81 | | |
81 | 82 | | |
82 | 83 | | |
83 | | - | |
| 84 | + | |
84 | 85 | | |
85 | | - | |
| 86 | + | |
86 | 87 | | |
87 | 88 | | |
88 | 89 | | |
| |||
91 | 92 | | |
92 | 93 | | |
93 | 94 | | |
94 | | - | |
| 95 | + | |
| 96 | + | |
95 | 97 | | |
96 | | - | |
| 98 | + | |
97 | 99 | | |
98 | | - | |
99 | | - | |
| 100 | + | |
| 101 | + | |
100 | 102 | | |
101 | | - | |
| 103 | + | |
102 | 104 | | |
103 | 105 | | |
104 | | - | |
| 106 | + | |
105 | 107 | | |
106 | 108 | | |
107 | 109 | | |
108 | | - | |
| 110 | + | |
109 | 111 | | |
110 | 112 | | |
111 | 113 | | |
112 | | - | |
113 | | - | |
114 | | - | |
115 | | - | |
116 | | - | |
117 | | - | |
118 | | - | |
119 | 114 | | |
0 commit comments