Open Closed

Questions about AI Framework & AI Management modules (availability and custom chat client integration) #10089


User avatar
0
Frontis2 created

I’m currently exploring the new AI-related features in ABP based on the following documentation pages:

https://abp.io/docs/10.0/framework/infrastructure/artificial-intelligence

https://abp.io/docs/10.0/modules/ai-management

I understand that these AI modules are currently in preview, and that’s perfectly fine for our use case.

I have a few concrete questions:

Using the preview modules

Is there anything specific we need to do or enable in order to start using and testing these AI modules in a real (but controlled) project?

Are there any important current limitations or “known gaps” we should be aware of when adopting the preview (e.g. missing scenarios, not-yet-implemented providers, configuration restrictions)?

Roadmap / planning

What is the current roadmap for these AI modules?

Are there specific milestones or upcoming features you can already share (for example around agent support, orchestration, management UI, etc.)?

Do you expect significant breaking changes in the APIs/configuration as the modules evolve, or do you aim to keep the current abstractions relatively stable?

Custom chat client calling an external API (AI agents)

We have a concrete customer scenario:

The customer wants us to build AI agents using ABP-based application.

At the same time, the customer is building their own API endpoint so they can host and manage AI agents themselves.

Our application should act as a client to that external AI/agent API.

In this context, we would like to know:

Can we configure a custom chat client that calls this external API endpoint using the ConfigureChatClient configuration?

If yes:

What is the recommended way to plug such a custom chat client into the AI infrastructure / AI Management module so that it behaves similarly to the built-in providers?

Do you have a minimal example (or guidance) for implementing a custom chat client that forwards requests to an arbitrary HTTP endpoint?

Our goal is to leverage the ABP AI abstractions (for consistency and future maintainability), while letting the actual AI/agent logic run in the customer’s own API.


4 Answer(s)
  • User Avatar
    0
    AI-Bot created
    Support Team ABP Agent
    1. Solution
    • Using the preview modules
      • Install and enable:
        • Add Volo.Abp.AI and Volo.Abp.AI.Management packages to your solution and add the corresponding module dependencies in your module classes.
        • Configure an IChatClient via Microsoft.Extensions.AI in your web (or application) module. ABP’s AI infrastructure is designed to work with Microsoft.Extensions.AI abstractions.
        • Example minimal setup (OpenAI shown as a reference provider):
    using Microsoft.Extensions.AI;
          using OpenAI;
    
          [DependsOn(
              typeof(AbpAIModule),          // AI infrastructure
              typeof(AiManagementModule)    // AI Management module
          )]
          public class MyProjectWebModule : AbpModule
          {
              public override void ConfigureServices(ServiceConfigurationContext context)
              {
                  var configuration = context.Services.GetConfiguration();
    
                  context.Services.AddSingleton(new OpenAIClient(configuration["AI:OpenAI:Key"]));
    
                  context.Services.AddChatClient(services =>
                      services.GetRequiredService<OpenAIClient>()
                              .AsChatClient(configuration["AI:OpenAI:Chat:ModelId"] ?? "gpt-4o-mini"));
              }
          }
    
    - appsettings.json example:
    
    {
            "AI": {
              "OpenAI": {
                "Key": "YOUR-KEY",
                "Chat": { "ModelId": "gpt-4o-mini" }
              }
            }
          }
    
    • Current limitations to be aware of (preview):

      • Provider coverage is driven by Microsoft.Extensions.AI integrations; features vary per provider (e.g., tool/function calling, images, embeddings). Ensure the chosen provider supports your required capabilities.
      • The AI Management module is evolving: management UI and orchestration features are being expanded; some scenarios may be incomplete in preview.
      • Expect changes while in preview; validate your configuration and keep packages in sync with the related ABP version.
    • Roadmap / planning

      • The modules are in preview; ABP aims to build on Microsoft.Extensions.AI and add management, configuration, and orchestration capabilities on top. Some features (like deeper agent/orchestration support and richer management UI) are planned and rolling out. While abstractions are intended to be stable, preview implies there may be breaking changes. Follow the docs/changelogs for updates as versions progress from preview to stable.
    • Custom chat client calling an external API (AI agents)

      • Yes, you can plug a custom chat client using ConfigureChatClient/AddChatClient. The recommended way is to implement Microsoft.Extensions.AI.IChatClient (or adapt an existing client) and register it, so the rest of ABP AI infrastructure and AI Management can use it like built-in providers.
      • Minimal example: forwarding to an arbitrary HTTP endpoint
    using System.Net.Http;
        using System.Net.Http.Json;
        using System.Threading;
        using System.Threading.Tasks;
        using Microsoft.Extensions.AI;
    
        public sealed class HttpForwardingChatClient : IChatClient
        {
            private readonly HttpClient _http;
            private readonly string _endpoint; // e.g. https://customer-api.example.com/agent/chat
    
            public HttpForwardingChatClient(HttpClient http, string endpoint)
            {
                _http = http;
                _endpoint = endpoint;
            }
    
            public async Task<ChatCompletion> CompleteAsync(
                ChatMessage message,
                ChatOptions options = null,
                CancellationToken cancellationToken = default)
            {
                var payload = new
                {
                    input = message.Text,
                    // optionally map options (system prompt, temperature, tools, etc.)
                };
    
                var response = await _http.PostAsJsonAsync(_endpoint, payload, cancellationToken);
                response.EnsureSuccessStatusCode();
                var result = await response.Content.ReadFromJsonAsync<ExternalResponse>(cancellationToken: cancellationToken);
    
                return new ChatCompletion(new ChatMessage(Role.Assistant, result?.Output ?? string.Empty));
            }
    
            // Implement other IChatClient members if needed by your use-cases (e.g., streaming)
            private sealed class ExternalResponse
            {
                public string Output { get; set; }
            }
        }
    

    Registering the custom client with ABP AI:

    [DependsOn(typeof(AbpAIModule), typeof(AiManagementModule))]
          public class MyProjectWebModule : AbpModule
          {
              public override void ConfigureServices(ServiceConfigurationContext context)
              {
                  var configuration = context.Services.GetConfiguration();
                  context.Services.AddHttpClient<HttpForwardingChatClient>(client =>
                  {
                      client.BaseAddress = new Uri(configuration["AI:ExternalAgent:BaseUrl"]);
                  });
    
                  context.Services.AddChatClient(sp =>
                      sp.GetRequiredService<HttpForwardingChatClient>());
              }
          }
    

    After registration, you can inject IChatClient anywhere (app services, pages, components) and AI Management can treat it similarly to built-in providers, as the integration point is the same abstraction (IChatClient). If your scenario requires streaming, tools/functions, or multi-turn context, implement the corresponding members or map the needed options to your external API.

    1. Sources
    • ABP AI infrastructure (preview) overview:
      • https://abp.io/docs/10.0/framework/infrastructure/artificial-intelligence
    • AI Management module:
      • https://abp.io/docs/10.0/modules/ai-management
    • Example of configuring IChatClient via Microsoft.Extensions.AI in ABP (community article showing the same patterns used by ABP AI):
      • https://abp.io/community/articles/rsfvihla

    This response was generated by AI. If it didn’t solve your problem, feel free to post a new answer — our support team will jump in to help you soon.

  • User Avatar
    0
    Frontis2 created

    AI agent answer is not relevant for us :)

  • User Avatar
    0
    Frontis2 created

    An answer would be appreciated.

  • User Avatar
    0
    enisn created
    Support Team .NET Developer

    Hi,

    That module is Preview now, and it's not stable yet. Breaking changes might happen.

    Is there anything specific we need to do or enable in order to start using and testing these AI modules in a real (but controlled) project?

    No need for a custom flag or enabling something in your project. ABP AI features based on Microsoft's packages and they're on -preview version mostly, this is the important point to know. If Microsoft.Extensions.AI makes a breaking-cahnge or drop some features during preview period, so it'll affect to our features too. That's why we haven't announced them yet.

    Are there any important current limitations or “known gaps” we should be aware of when adopting the preview (e.g. missing scenarios, not-yet-implemented providers, configuration restrictions)?

    In our scenario, we are trying to move forward with firm steps. So, essential features like RAG and Vector Store options are not implemented yet. We're waiting for the stability of the infrastructure and waiting Microsoft's next steps, like Agent Framework, which was announced during Dotnet Conf this year. We closely follow updates from this, and our AI modules will be based on the Agent Framework in the near future.

    Roadmap / planning What is the current roadmap for these AI modules?

    As I mentioned, we'll be based on Agent Framework soon, and also RAG and Vector Store Options, MCP Server building infrastructure etc. will be implemented. But we're still waiting the stable packages from Microsoft first to continue further.

    Can we configure a custom chat client that calls this external API endpoint using the ConfigureChatClient configuration?

    Yes, but if that external APIis compatible with OpenAI API standards, you can connect it as an OpenAI Client. Or an alternative scenario, if that external API is built with ABP and uses the AI Management module, you can directly connect it by using HttpApi.Client package as always.

    Do you have a minimal example (or guidance) for implementing a custom chat client that forwards requests to an arbitrary HTTP endpoint?

    This section might be the scenario that you're looking for. But both applications should use the AI Management module.

    https://abp.io/docs/latest/modules/ai-management#scenario-3-ai-management-client-with-remote-execution

Boost Your Development
ABP Live Training
Packages
See Trainings
Mastering ABP Framework Book
The Official Guide
Mastering
ABP Framework
Learn More
Mastering ABP Framework Book
Made with ❤️ on ABP v10.1.0-preview. Updated on December 03, 2025, 13:19
1
ABP Assistant
🔐 You need to be logged in to use the chatbot. Please log in first.