Skip to content

Commit 65370e3

Browse files
committed
Merge branch 'dev' into Shared-User-Account
2 parents 2442992 + 96b2d7e commit 65370e3

File tree

27 files changed

+881
-94
lines changed

27 files changed

+881
-94
lines changed
42.9 KB
Loading
32.7 KB
Loading
48.3 KB
Loading
11.1 KB
Loading
10.2 KB
Loading
Lines changed: 106 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,106 @@
1+
# Introducing the AI Management Module: Manage AI Integration Dynamically
2+
3+
We are excited to announce the **AI Management Module**, a powerful new module to the ABP Platform that makes managing AI capabilities in your applications easier. No need to redeploy your application, now you can configure, test, and manage your AI integrations on the fly through an intuitive user interface!
4+
5+
## What is the AI Management Module?
6+
7+
Built on top of the [ABP Framework's AI infrastructure](https://abp.io/docs/latest/framework/infrastructure/artificial-intelligence), the AI Management Module allows you to manage AI workspaces dynamically without touching your code. Whether you're building a customer support chatbot, adding AI-powered search, or creating intelligent automation workflows, this module provides everything you need to manage AI integrations through a user-friendly interface.
8+
9+
> **Note**: The AI Management Module is currently in **preview** and available to ABP Team or higher license holders.
10+
11+
## What it offers?
12+
13+
### Manage AI Without Redeployment
14+
15+
Create, configure, and update AI workspaces directly from the UI. Switch between different AI providers (OpenAI, Azure OpenAI, Ollama, etc.), change models, adjust prompts, and test configurations, all without restarting your application or deploying new code.
16+
17+
### Built-In Chat Interface
18+
19+
Test your AI workspaces immediately with the included chat interface in playground pages. Verify your configurations work correctly before using them in production. Perfect for experimenting with different models, prompts, and settings.
20+
21+
![AI Management Playground](./images/ai-management-workspace-playground.png)
22+
23+
### Flexible for Any Architecture
24+
25+
Whether you're building a monolith, microservices, or something in between, the module adapts to your needs:
26+
- Host AI management directly in your application with full UI and database
27+
- Deploy a centralized AI service that multiple applications can consume
28+
- Use it as an API gateway pattern for your microservices
29+
30+
### Works with Any AI Provider
31+
32+
Even AI Management module doesn't implement all the providers by default, it provides extensibility options with a good abstraction for other providers like Azure, Anthropic Claude, Google Gemini, and more. Or you can directly use the OpenAI adapter with LLMs that support OpenAI API.
33+
34+
- Example of using Gemini as an OpenAI provider:
35+
36+
![Using Gemini as an OpenAI provider](./images/aimanagement-workspace-geminiasopenai.png)
37+
38+
39+
You can even add your own custom AI providers: [learn how to implement a custom AI provider factory in the documentation](https://abp.io/docs/latest/modules/ai-management#implementing-custom-ai-provider-factories).
40+
41+
### Ready to Use Chat Widget
42+
43+
Drop a compact, pre-built chat widget into any page with minimal code. It includes streaming support, conversation history, and API integration for customization.
44+
45+
- Simple to use with minimal code
46+
```cs
47+
@await Component.InvokeAsync(typeof(ChatClientChatViewComponent), new ChatClientChatViewModel
48+
{
49+
WorkspaceName = "StoryTeller",
50+
})
51+
```
52+
53+
- And result is a working, pre-integrated widget
54+
55+
![AI Management Chat Widget](./images/ai-management-workspace-widget.png)
56+
57+
- [See the widget documentation](https://abp.io/docs/latest/modules/ai-management#client-usage-mvc-ui) for details and all parameters for customization.
58+
59+
### Security
60+
61+
Control who can manage and use AI workspaces with permission-based access control. Isolate your AI configurations by using workspaces with different permissions. Also, resource based authorization on workspaces is on the way and will be available in the next versions. It'll allow you to manage access to specific workspaces by a user or role.
62+
63+
## Getting Started
64+
65+
Installation is straightforward using the [ABP Studio](https://abp.io/studio). You can just enable **AI Management** module while creating a new project with ABP Studio and configure your preferred AI provider and model in the solution creation wizard.
66+
67+
![ABP Studio AI Management Solution Creation Wizard](./images/abp-studio-ai-management.png)
68+
69+
## Roadmap
70+
71+
### v10.0 ✅
72+
- Workspace Management
73+
- MVC UI
74+
- Playground
75+
- Chat History _(Client-Side)_
76+
- Client Components
77+
- Integration to Startup Templates
78+
79+
### v10.1
80+
- Blazor UI
81+
- Angular UI
82+
- Resource based authorization on Workspaces
83+
- Agent-Framework compatibility examples
84+
85+
### Future Goals
86+
- Microservice templates
87+
- MCP Support
88+
- RAG with file upload _(md, pdf, txt)_
89+
- Chat History _(Server-Side Conversations)_
90+
- OpenAI Compatible Endpoints
91+
- Tenant-Based Configuration
92+
- Extended RAG capabilities, _(ie. providing application data as tools)_
93+
94+
95+
## Ready to Get Started?
96+
97+
The AI Management Module is available now for ABP Team and higher license holders.
98+
99+
**Learn More:**
100+
- [AI Management Module Documentation](https://abp.io/docs/latest/modules/ai-management) - All features, scenarios, and technical details.
101+
- [AI Infrastructure Documentation](https://abp.io/docs/latest/framework/infrastructure/artificial-intelligence) - Understanding AI workspaces in the framework.
102+
- [Usage Scenarios](https://abp.io/docs/latest/modules/ai-management#usage-scenarios) - Examples for different architectures.
103+
104+
---
105+
106+
*The AI Management Module is currently in preview. We're excited to hear your feedback as we continue to improve and add new features!*

docs/en/docs-nav.json

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -563,7 +563,11 @@
563563
{
564564
"text": "Microsoft.Extensions.AI",
565565
"path": "framework/infrastructure/artificial-intelligence/microsoft-extensions-ai.md"
566-
},
566+
},
567+
{
568+
"text": "Agent Framework",
569+
"path": "framework/infrastructure/artificial-intelligence/microsoft-agent-framework.md"
570+
},
567571
{
568572
"text": "Semantic Kernel",
569573
"path": "framework/infrastructure/artificial-intelligence/microsoft-semantic-kernel.md"
@@ -2355,13 +2359,17 @@
23552359
"path": "modules/account-pro.md",
23562360
"isIndex": true
23572361
},
2362+
{
2363+
"text": "Idle Session Timeout",
2364+
"path": "modules/account/idle-session-timeout.md"
2365+
},
23582366
{
23592367
"text": "Tenant impersonation & User impersonation",
23602368
"path": "modules/account/impersonation.md"
23612369
},
23622370
{
2363-
"text": "Idle Session Timeout",
2364-
"path": "modules/account/idle-session-timeout.md"
2371+
"text": "Web Authentication API (WebAuthn) passkeys",
2372+
"path": "modules/account/passkey.md"
23652373
}
23662374
]
23672375
},

docs/en/framework/infrastructure/artificial-intelligence/index.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,14 @@ abp add-package Volo.Abp.AI
2727
The `Volo.Abp.AI` package provides integration with the following libraries:
2828

2929
* [Microsoft.Extensions.AI](https://learn.microsoft.com/en-us/dotnet/ai/microsoft-extensions-ai)
30+
* [Microsoft.Agents.AI (Agent Framework)](https://learn.microsoft.com/en-us/agent-framework/overview/agent-framework-overview)
3031
* [Microsoft.SemanticKernel](https://learn.microsoft.com/en-us/semantic-kernel/overview/)
3132

32-
The Microsoft.Extensions.AI library is suggested for library developers to keep the library dependency minimum and simple (since it provides basic abstractions and fundamental AI provider integrations), while Semantic Kernel is suggested for applications that need rich and advanced AI integration features.
33+
The **Microsoft.Extensions.AI** library is suggested for library developers to keep the library dependency minimum and simple (since it provides basic abstractions and fundamental AI provider integrations). For applications, **Microsoft Agent Framework** is the recommended choice as it combines the best of both AutoGen and Semantic Kernel (it's direct successor of these two frameworks), offering simple abstractions for single- and multi-agent patterns along with advanced features like thread-based state management, type safety, filters, and telemetry. **Semantic Kernel** can still be used if you need its specific AI integration features.
3334

3435
Check the following documentation to learn how to use these libraries with the ABP integration:
3536

3637
- [ABP Microsoft.Extensions.AI integration](./microsoft-extensions-ai.md)
38+
- [ABP Microsoft.Agents.AI (Agent Framework) integration](./microsoft-agent-framework.md)
3739
- [ABP Microsoft.SemanticKernel integration](./microsoft-semantic-kernel.md)
3840

Lines changed: 218 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,218 @@
1+
# Microsoft.Agents.AI (Agent Framework)
2+
3+
[Microsoft Agent Framework](https://learn.microsoft.com/en-us/agent-framework/overview/agent-framework-overview) is an open-source development kit for **building AI agents** and **multi-agent workflows**. It is the direct successor to both *AutoGen* and [*Semantic Kernel*](./microsoft-semantic-kernel.md), combining their strengths while adding new capabilities, and is the suggested framework for building AI agent applications. This documentation is about the usage of this library with ABP Framework. Make sure you have read the [Artificial Intelligence](./index.md) documentation before reading this documentation.
4+
5+
## Usage
6+
7+
**Microsoft Agent Framework** works on top of `IChatClient` from **Microsoft.Extensions.AI**. After obtaining an `IChatClient` instance, you can create an AI agent using the `CreateAIAgent` extension method:
8+
9+
```csharp
10+
using Microsoft.Agents.AI;
11+
using Microsoft.Extensions.AI;
12+
13+
public class MyService
14+
{
15+
private readonly IChatClient _chatClient;
16+
17+
public MyService(IChatClient chatClient)
18+
{
19+
_chatClient = chatClient;
20+
}
21+
22+
public async Task<string> GetResponseAsync(string userMessage)
23+
{
24+
AIAgent agent = _chatClient.CreateAIAgent(
25+
instructions: "You are a helpful assistant that provides concise answers."
26+
);
27+
28+
AgentRunResponse response = await agent.RunAsync(userMessage);
29+
30+
return response.Text;
31+
}
32+
}
33+
```
34+
35+
You can also use `IChatClientAccessor` to access the `IChatClient` in scenarios where AI capabilities are **optional**, such as when developing a module or a service that may use AI capabilities optionally:
36+
37+
```csharp
38+
using Microsoft.Agents.AI;
39+
using Microsoft.Extensions.AI;
40+
using Volo.Abp.AI;
41+
42+
public class MyService
43+
{
44+
private readonly IChatClientAccessor _chatClientAccessor;
45+
46+
public MyService(IChatClientAccessor chatClientAccessor)
47+
{
48+
_chatClientAccessor = chatClientAccessor;
49+
}
50+
51+
public async Task<string> GetResponseAsync(string userMessage)
52+
{
53+
var chatClient = _chatClientAccessor.ChatClient;
54+
if (chatClient is null)
55+
{
56+
return "No chat client configured";
57+
}
58+
59+
AIAgent agent = chatClient.CreateAIAgent(
60+
instructions: "You are a helpful assistant that provides concise answers."
61+
);
62+
63+
var response = await agent.RunAsync(userMessage);
64+
65+
return response.Text;
66+
}
67+
}
68+
```
69+
70+
### Workspaces
71+
72+
Workspaces are a way to configure isolated AI configurations for a named scope. You can define a workspace by decorating a class with the `WorkspaceNameAttribute` attribute that carries the workspace name.
73+
- Workspace names must be unique.
74+
- Workspace names cannot contain spaces _(use underscores or camelCase)_.
75+
- Workspace names are case-sensitive.
76+
77+
```csharp
78+
using Volo.Abp.AI;
79+
80+
[WorkspaceName("CommentSummarization")]
81+
public class CommentSummarization
82+
{
83+
}
84+
```
85+
86+
> [!NOTE]
87+
> If you don't specify the workspace name, the full name of the class will be used as the workspace name.
88+
89+
You can resolve generic versions of `IChatClient` and `IChatClientAccessor` services for a specific workspace as generic arguments. If Chat Client is not configured for a workspace, you will get `null` from the accessor services. You should check the accessor before using it. This applies only for specified workspaces. Another workspace may have a configured Chat Client.
90+
91+
`IChatClient<TWorkSpace>` or `IChatClientAccessor<TWorkSpace>` can be resolved to access a specific workspace's chat client. This is a typed chat client and can be configured separately from the default chat client.
92+
93+
Example of resolving a typed chat client for a workspace:
94+
95+
```csharp
96+
using Microsoft.Agents.AI;
97+
using Microsoft.Extensions.AI;
98+
using Volo.Abp.AI;
99+
100+
public class MyService
101+
{
102+
private readonly IChatClient<CustomerSupport> _chatClient;
103+
104+
public MyService(IChatClient<CustomerSupport> chatClient)
105+
{
106+
_chatClient = chatClient;
107+
}
108+
109+
public async Task<string> GetResponseAsync(string userMessage)
110+
{
111+
AIAgent agent = _chatClient.CreateAIAgent(
112+
instructions: "You are a customer support assistant. Be polite and helpful."
113+
);
114+
115+
var response = await agent.RunAsync(userMessage);
116+
return response.Text;
117+
}
118+
}
119+
```
120+
121+
Example of resolving a typed chat client accessor for a workspace:
122+
123+
```csharp
124+
using Microsoft.Agents.AI;
125+
using Microsoft.Extensions.AI;
126+
using Volo.Abp.AI;
127+
128+
public class MyService
129+
{
130+
private readonly IChatClientAccessor<CustomerSupport> _chatClientAccessor;
131+
132+
public MyService(IChatClientAccessor<CustomerSupport> chatClientAccessor)
133+
{
134+
_chatClientAccessor = chatClientAccessor;
135+
}
136+
137+
public async Task<string> GetResponseAsync(string userMessage)
138+
{
139+
var chatClient = _chatClientAccessor.ChatClient;
140+
if (chatClient is null)
141+
{
142+
return "No chat client configured";
143+
}
144+
145+
AIAgent agent = chatClient.CreateAIAgent(
146+
instructions: "You are a customer support assistant. Be polite and helpful."
147+
);
148+
149+
var response = await agent.RunAsync(userMessage);
150+
return response.Text;
151+
}
152+
}
153+
```
154+
155+
## Configuration
156+
157+
**Microsoft Agent Framework** uses `IChatClient` from **Microsoft.Extensions.AI** as its foundation. Therefore, the configuration process for workspaces is the same as described in the [Microsoft.Extensions.AI documentation](./microsoft-extensions-ai.md#configuration).
158+
159+
You need to configure the Chat Client for your workspace using `AbpAIWorkspaceOptions`, and then you can use the `CreateAIAgent` extension method to create AI agents from the configured chat client.
160+
161+
To configure a chat client, you'll need a LLM provider package such as [Microsoft.Extensions.AI.OpenAI](https://www.nuget.org/packages/Microsoft.Extensions.AI.OpenAI) or [OllamaSharp](https://www.nuget.org/packages/OllamaSharp/).
162+
163+
_The following example requires [OllamaSharp](https://www.nuget.org/packages/OllamaSharp/) package to be installed._
164+
165+
Demonstration of the default workspace configuration:
166+
167+
```csharp
168+
[DependsOn(typeof(AbpAIModule))]
169+
public class MyProjectModule : AbpModule
170+
{
171+
public override void PreConfigureServices(ServiceConfigurationContext context)
172+
{
173+
PreConfigure<AbpAIWorkspaceOptions>(options =>
174+
{
175+
options.Workspaces.ConfigureDefault(configuration =>
176+
{
177+
configuration.ConfigureChatClient(chatClientConfiguration =>
178+
{
179+
chatClientConfiguration.Builder = new ChatClientBuilder(
180+
sp => new OllamaApiClient("http://localhost:11434", "mistral")
181+
);
182+
});
183+
});
184+
});
185+
}
186+
}
187+
```
188+
189+
Demonstration of the isolated workspace configuration:
190+
191+
```csharp
192+
[DependsOn(typeof(AbpAIModule))]
193+
public class MyProjectModule : AbpModule
194+
{
195+
public override void PreConfigureServices(ServiceConfigurationContext context)
196+
{
197+
PreConfigure<AbpAIWorkspaceOptions>(options =>
198+
{
199+
options.Workspaces.Configure<CustomerSupport>(configuration =>
200+
{
201+
configuration.ConfigureChatClient(chatClientConfiguration =>
202+
{
203+
chatClientConfiguration.Builder = new ChatClientBuilder(
204+
sp => new OllamaApiClient("http://localhost:11434", "mistral")
205+
);
206+
});
207+
});
208+
});
209+
}
210+
}
211+
```
212+
213+
## See Also
214+
215+
- [Usage of Microsoft.Extensions.AI](./microsoft-extensions-ai.md)
216+
- [Usage of Semantic Kernel](./microsoft-semantic-kernel.md)
217+
- [Microsoft Agent Framework Overview](https://learn.microsoft.com/en-us/agent-framework/overview/agent-framework-overview)
218+
- [AI Samples for .NET](https://learn.microsoft.com/en-us/samples/dotnet/ai-samples/ai-samples/)

docs/en/framework/infrastructure/artificial-intelligence/microsoft-extensions-ai.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,5 +172,6 @@ public class MyProjectModule : AbpModule
172172

173173
## See Also
174174

175+
- [Usage of Agent Framework](./microsoft-agent-framework.md)
175176
- [Usage of Semantic Kernel](./microsoft-semantic-kernel.md)
176177
- [AI Samples for .NET](https://learn.microsoft.com/en-us/samples/dotnet/ai-samples/ai-samples/)

0 commit comments

Comments
 (0)