Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
1fabf81
Fix User DisplayName cache (#182)
MikeAlhayek Oct 8, 2025
502d627
Fix the instructions in the project's readme file (#184)
MikeAlhayek Oct 8, 2025
b1f17df
Allow creating AI Chat Session Programatically (#185)
MikeAlhayek Oct 10, 2025
0f2f6e0
Use CacheContext in author cache (#186)
MikeAlhayek Oct 11, 2025
27b88c3
Auto-generate technical name for AI profile. (#189)
MikeAlhayek Oct 20, 2025
a63add4
Enable maximum output tokens by default in the AI profile. (#188)
MikeAlhayek Oct 20, 2025
1c8bbb7
Rename ModelHandlerBase to CatalogEntryHandlerBase (#192)
MikeAlhayek Oct 21, 2025
1ac8f8b
Add 'AICompletionWithConfigTask' workflow task (#193)
MikeAlhayek Oct 23, 2025
703893c
Update packages (#194)
MikeAlhayek Oct 23, 2025
8abc596
Use the new UserDisplayName shapes (#195)
MikeAlhayek Oct 23, 2025
279b02c
Remove all Obsolete attributes (#197)
MikeAlhayek Oct 23, 2025
cd422b4
Fix deployment selection in UI and display detailed chat errors (#198)
MikeAlhayek Oct 24, 2025
2c0412a
Add ability to delete chat history items individually or clear all at…
Copilot Oct 24, 2025
dafbf94
Auto generate Techinal Name value (#200)
MikeAlhayek Oct 24, 2025
8da7023
Improve AI Provider Configuation Documents (#201)
MikeAlhayek Oct 24, 2025
50bc74b
Adding example configurations for common providers (#204)
Piedone Oct 26, 2025
9f106be
Fix IAIProfileManager (#205)
MikeAlhayek Oct 27, 2025
df15c45
Add AIProfile actions menu and relocate views into Items folder (#207)
MikeAlhayek Oct 28, 2025
964e053
Add CatalogItemMigrations migration to migrate Id to ItemId (#208)
MikeAlhayek Oct 29, 2025
e336c98
Don't use transcation inside the Id to ItemId migration (#209)
MikeAlhayek Oct 29, 2025
1b9e3c7
Fix duplicate key in AIDeploymentDeploymentSource (#210)
MikeAlhayek Oct 29, 2025
8ab4072
Add a way to delete deployments via recipes (#211)
MikeAlhayek Oct 29, 2025
ba87656
Decouple AI Client from AI Profile (#215)
MikeAlhayek Oct 31, 2025
0b488ab
Avoid an error when calling function (#216)
MikeAlhayek Nov 5, 2025
ae0de3a
Add table of contents to module README files (#220)
Copilot Nov 7, 2025
411352d
Fix AI Deployments, Deployment steps (#221)
MikeAlhayek Nov 13, 2025
35e8567
Reduce token usage for session title generation and prevent NRE (#223)
MikeAlhayek Nov 18, 2025
2e99d97
Migrate to .net10 (#225)
MikeAlhayek Nov 19, 2025
cd4bbcf
Fix Main CI (#226)
MikeAlhayek Nov 19, 2025
52bade4
Fix Bugs with Azure OpenAI library (#228)
MikeAlhayek Dec 2, 2025
b12baad
Avoid Using AzureOpenAIClient from Azure.AI.OpenAI (#227)
MikeAlhayek Dec 9, 2025
aafcf6e
Continue to use AzureOpenAIClient with Azure (#230)
MikeAlhayek Dec 9, 2025
d49ff74
Fix tool calling while using own data (#232)
MikeAlhayek Dec 11, 2025
5d9c13b
Don't show system down message when the user navigate away (#233)
MikeAlhayek Dec 11, 2025
f7fa7be
Add Copilot setup workflow to restore NuGet packages before firewall …
Copilot Dec 26, 2025
f4a56b4
Rename setup job to copilot-setup-steps (#236)
MikeAlhayek Jan 2, 2026
7893ff6
Fix for AIProviderConnection Type ( Chat || Embedding) (#239)
JackTelford Jan 6, 2026
5b901c9
Remove AI Connection Type (#242)
MikeAlhayek Jan 7, 2026
a6a9cf9
Add Chat Interactions feature for ad-hoc AI chat experiences with doc…
Copilot Jan 8, 2026
e3ac144
Initial plan
Copilot Jan 8, 2026
7ecaac2
Merge main into copilot/sub-pr-6
Jan 8, 2026
567de52
Add workflow events for subscription lifecycle
Copilot Jan 8, 2026
ad2a915
Enhance confirmation step with detailed subscription information
Copilot Jan 8, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
23 changes: 23 additions & 0 deletions .github/workflows/copilot-setup-steps.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# This workflow runs before the Copilot coding agent's firewall is enabled.
# It restores NuGet packages from external sources that would otherwise be blocked.
# See: https://docs.github.com/en/copilot/customizing-copilot/customizing-the-development-environment-for-copilot-coding-agent

name: Copilot Setup Steps

on: copilot_setup

jobs:
copilot-setup-steps:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Setup .NET SDK
uses: actions/setup-dotnet@v4
with:
dotnet-version: |
10.0.x

- name: Restore NuGet packages
run: dotnet restore
3 changes: 1 addition & 2 deletions .github/workflows/main_ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,7 @@ jobs:
- uses: actions/setup-dotnet@v4
with:
dotnet-version: |
8.0.x
9.0.x
10.0.x
- name: Build
# See pr_ci.yml for the reason why we disable NuGet audit warnings.
run: |
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/pr_ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,7 @@ jobs:
- uses: actions/setup-dotnet@v4
with:
dotnet-version: |
8.0.x
9.0.x
10.0.x
- name: Build
# We disable NuGet audit warnings, see https://learn.microsoft.com/en-us/nuget/reference/errors-and-warnings/nu1901-nu1904.
# Security issues being discovered in NuGet packages we use can happen at any time, and thus all our CI builds that
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/preview_ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,7 @@ jobs:
if: steps.check-publish.outputs.should-publish == 'true'
with:
dotnet-version: |
8.0.x
9.0.x
10.0.x
- name: Set build number
if: steps.check-publish.outputs.should-publish == 'true'
run: echo "BuildNumber=$(( $GITHUB_RUN_NUMBER ))" >> $GITHUB_ENV
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/release_ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,7 @@ jobs:
- uses: actions/setup-dotnet@v4
with:
dotnet-version: |
8.0.x
9.0.x
10.0.x
- name: Set build number
if: matrix.os == 'ubuntu-latest'
run: echo "BuildNumber=$(( $GITHUB_RUN_NUMBER ))" >> $GITHUB_ENV
Expand Down
4 changes: 2 additions & 2 deletions Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@

<!-- TFM used when coding in Visual Studio and when creating templates -->
<!-- All 'template.json' should provide a 'choice' for the default TFM -->
<DefaultTargetFramework Condition="'$(DefaultTargetFramework)' == ''">net9.0</DefaultTargetFramework>
<DefaultTargetFramework Condition="'$(DefaultTargetFramework)' == ''">net10.0</DefaultTargetFramework>

<!-- TFMs used to build the abstractions and modules, by convention the default TFM is at the first position -->
<!-- In a cross-targeting build, some assets are only copied on the first TFM, by convention the default TFM -->
<CommonTargetFrameworks Condition="'$(CommonTargetFrameworks)' == ''">net9.0</CommonTargetFrameworks>
<CommonTargetFrameworks Condition="'$(CommonTargetFrameworks)' == ''">net10.0</CommonTargetFrameworks>
</PropertyGroup>

<!-- Detect if the solution is opened in VS to limit the TFMs that are analyzed by Roslyn for performance reasons -->
Expand Down
58 changes: 29 additions & 29 deletions Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,20 @@
<PropertyGroup>
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
<CentralPackageTransitivePinningEnabled>true</CentralPackageTransitivePinningEnabled>
<OrchardCoreVersion>[3.0.0-preview-18752, )</OrchardCoreVersion>
<OrchardCoreVersion>[3.0.0-preview-18874, )</OrchardCoreVersion>
</PropertyGroup>
<ItemGroup>
<!-- Miscellaneous Packages -->
<PackageVersion Include="JsonSchema.Net" Version="7.4.0" />
<PackageVersion Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="9.0.8" />
<PackageVersion Include="NuGet.Versioning" Version="6.14.0" />
<PackageVersion Include="OllamaSharp" Version="5.3.4" />
<PackageVersion Include="YesSql.Abstractions" Version="5.4.6" />
<PackageVersion Include="YesSql.Core" Version="5.4.6" />
<PackageVersion Include="ModelContextProtocol" Version="0.3.0-preview.3" />
<PackageVersion Include="ModelContextProtocol.AspNetCore" Version="0.3.0-preview.3" />
<PackageVersion Include="ModelContextProtocol" Version="0.3.0-preview.1" />
<PackageVersion Include="ModelContextProtocol.AspNetCore" Version="0.1.0-preview.7" />
<Packageversion Include="Stripe.net" Version="47.4.0" />
<PackageVersion Include="NuGet.Versioning" Version="7.0.1" />
<PackageVersion Include="OllamaSharp" Version="5.4.11" />
<PackageVersion Include="YesSql.Abstractions" Version="5.4.7" />
<PackageVersion Include="YesSql.Core" Version="5.4.7" />
<PackageVersion Include="ModelContextProtocol" Version="0.4.0-preview.3" />
<PackageVersion Include="ModelContextProtocol.AspNetCore" Version="0.4.0-preview.4" />
<PackageVersion Include="DocumentFormat.OpenXml" Version="3.3.0" />
<PackageVersion Include="PdfPig" Version="0.1.13" />
<PackageVersion Include="Stripe.net" Version="47.4.0" />
</ItemGroup>
<ItemGroup>
<!-- OrchardCore Packages -->
Expand Down Expand Up @@ -52,6 +51,7 @@
<PackageVersion Include="OrchardCore.ResourceManagement" Version="$(OrchardCoreVersion)" />
<PackageVersion Include="OrchardCore.Search.AzureAI.Core" Version="$(OrchardCoreVersion)" />
<PackageVersion Include="OrchardCore.Search.Elasticsearch.Core" Version="$(OrchardCoreVersion)" />
<PackageVersion Include="OrchardCore.Indexing.Abstractions" Version="$(OrchardCoreVersion)" />
<PackageVersion Include="OrchardCore.Setup.Abstractions" Version="$(OrchardCoreVersion)" />
<PackageVersion Include="OrchardCore.Setup.Core" Version="$(OrchardCoreVersion)" />
<PackageVersion Include="OrchardCore.Sms.Abstractions" Version="$(OrchardCoreVersion)" />
Expand All @@ -75,30 +75,30 @@
</ItemGroup>
<ItemGroup>
<!-- Microsoft Packages -->
<PackageVersion Include="Azure.AI.OpenAI" Version="2.3.0-beta.1" />
<PackageVersion Include="Azure.Identity" Version="1.15.0" />
<PackageVersion Include="Microsoft.AspNetCore.Authentication.OpenIdConnect" Version="9.0.8" />
<PackageVersion Include="Microsoft.AspNetCore.SignalR" Version="1.2.0" />
<PackageVersion Include="Microsoft.AspNetCore.SignalR.Core" Version="1.2.0" />
<PackageVersion Include="Microsoft.Extensions.AI" Version="9.8.0" />
<PackageVersion Include="Microsoft.Extensions.AI.Abstractions" Version="9.8.0" />
<PackageVersion Include="Microsoft.Extensions.AI.OpenAI" Version="9.7.1-preview.1.25365.4" />
<PackageVersion Include="Microsoft.Extensions.AI.AzureAIInference" Version="9.7.1-preview.1.25365.4" />
<PackageVersion Include="Microsoft.Extensions.Http.Resilience" Version="9.8.0" />
<PackageVersion Include="Azure.AI.OpenAI" Version="2.7.0-beta.2" />
<PackageVersion Include="Azure.Identity" Version="1.17.1" />
<PackageVersion Include="Microsoft.AspNetCore.Authentication.OpenIdConnect" Version="10.0.1" />
<PackageVersion Include="Microsoft.Extensions.AI" Version="10.0.1" />
<PackageVersion Include="Microsoft.Extensions.AI.Abstractions" Version="10.0.1" />
<PackageVersion Include="Microsoft.Extensions.AI.OpenAI" Version="10.0.1-preview.1.25571.5" />
<PackageVersion Include="Microsoft.Extensions.AI.AzureAIInference" Version="10.0.0-preview.1.25559.3" />
<PackageVersion Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="10.0.1" />
<PackageVersion Include="Microsoft.Extensions.Http.Resilience" Version="10.1.0" />
</ItemGroup>
<ItemGroup>
<!-- Testing Packages -->
<PackageVersion Include="Moq" Version="4.20.72" />
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.14.1" />
<PackageVersion Include="xunit.v3" Version="3.0.0" />
<PackageVersion Include="xunit.analyzers" Version="1.23.0" />
<PackageVersion Include="xunit.runner.visualstudio" Version="3.1.3" />
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="18.0.1" />
<PackageVersion Include="xunit.v3" Version="3.2.1" />
<PackageVersion Include="xunit.analyzers" Version="1.26.0" />
<PackageVersion Include="xunit.runner.visualstudio" Version="3.1.5" />
<PackageVersion Include="xunit.runner.inproc" Version="3.2.0" />
</ItemGroup>
<ItemGroup>
<!-- Aspire Packages -->
<PackageVersion Include="Aspire.Hosting.AppHost" Version="9.4.1" />
<PackageVersion Include="Aspire.Hosting.Elasticsearch" Version="9.2.1-preview.1.25222.1" />
<PackageVersion Include="Aspire.Hosting.Redis" Version="9.4.1" />
<PackageVersion Include="CommunityToolkit.Aspire.Hosting.Ollama" Version="9.7.0" />
<PackageVersion Include="Aspire.Hosting.AppHost" Version="13.0.1" />
<PackageVersion Include="Aspire.Hosting.Elasticsearch" Version="13.0.0" />
<PackageVersion Include="Aspire.Hosting.Redis" Version="13.0.1" />
<PackageVersion Include="CommunityToolkit.Aspire.Hosting.Ollama" Version="13.0.0" />
</ItemGroup>
</Project>
17 changes: 14 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,14 @@ Provides services for all AI modules and provide the interface for managing AI p
#### AI Chat Module
Provides interface for interacting with AI chat models like **ChatGPT** and others. See the [AI Chat Module README](src/Modules/CrestApps.OrchardCore.AI.Chat/README.md) for more details.

#### AI Chat Interactions Module
Enables ad-hoc AI chat experiences with configurable parameters, document upload, and RAG (Retrieval Augmented Generation) support. Users can chat with AI models without predefined profiles and upload documents to chat against their own data. See the [AI Chat Interactions README](src/Modules/CrestApps.OrchardCore.AI.Chat.Interactions/README.md) for more details.

**Extension modules:**
- [AI Chat Interactions - Documents](src/Modules/CrestApps.OrchardCore.AI.Chat.Interactions/README-Documents.md) - Document upload and RAG support
- [AI Chat Interactions - PDF](src/Modules/CrestApps.OrchardCore.AI.Chat.Interactions.Pdf/README.md) - PDF document support
- [AI Chat Interactions - OpenXml](src/Modules/CrestApps.OrchardCore.AI.Chat.Interactions.OpenXml/README.md) - Word, Excel, PowerPoint support

#### Orchard Core AI Agent Module
Enhances the **AI Module** by providing AI Agents to perform tasks on your Orchard Core site. For more details, see the [Orchard Core AI Agent Module README](src/Modules/CrestApps.OrchardCore.AI.Agent/README.md).

Expand Down Expand Up @@ -94,6 +102,9 @@ Enables you to restrict content items based on user roles. See the [Content Acce
#### Resources Module
Provides additional resources to accelerate development. See the [Resources Module README](src/Modules/CrestApps.OrchardCore.Resources/README.md).

#### CrestApps Recipes Module
Provides a structured way to define and retrieve recipe steps. See the [CrestApps Recipes Module README](src/Modules/CrestApps.OrchardCore.Recipes/README.md).

## Getting Started

### Running Locally
Expand Down Expand Up @@ -128,10 +139,10 @@ Follow these steps to get started with CrestApps:

This project is actively maintained and evolves alongside Orchard Core.

* If you're using Orchard Core versions from `2.1` up to `2.2`, please use package version `1.2.0-beta-0014`.
* For Orchard Core `3.0.0-preview-18752` and later, use version `2.0.0-beta-0006` or newer.
* If you're using Orchard Core versions from `2.1` up to `2.3`, please use package version `1.2.x`.
* For Orchard Core `3.0.0-preview-18823` and later, please use version `2.0.0-beta-0007` or newer.

**Note:** The reason for this split is that Orchard Core `3.0.0-preview-18669` upgraded to YesSql `5.4.1`, which introduced a binary breaking change. As a result, we had to divide development into two branches to maintain compatibility.
**Note:** In Orchard Core v3 multiple breaking changes were introduced to improve the framework. As a result, we had to divide development into two branches to maintain compatibility.

### Production Packages
Stable releases are available on [NuGet.org](https://www.nuget.org/).
Expand Down
2 changes: 1 addition & 1 deletion global.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"sdk": {
"version": "9.0.100",
"version": "10.0.100",
"rollForward": "latestMajor"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
<ItemGroup>
<PackageReference Include="OrchardCore.Infrastructure.Abstractions" />
<PackageReference Include="Microsoft.Extensions.AI.Abstractions" />
<PackageReference Include="OrchardCore.Indexing.Abstractions" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
namespace CrestApps.OrchardCore.AI;

/// <summary>
/// Represents a search result from the document index.
/// </summary>
public sealed class DocumentChunkSearchResult
{
/// <summary>
/// Gets or sets the document chunk.
/// </summary>
public Models.ChatInteractionDocumentChunk Chunk { get; set; }

/// <summary>
/// Gets or sets the similarity score.
/// </summary>
public float Score { get; set; }
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
using CrestApps.OrchardCore.AI.Models;

namespace CrestApps.OrchardCore.AI;

/// <summary>
/// Context for document indexing operations.
/// </summary>
public sealed class DocumentIndexContext
{
/// <summary>
/// Gets or sets the session/interaction identifier.
/// </summary>
public string SessionId { get; set; }

/// <summary>
/// Gets or sets the document identifier.
/// </summary>
public string DocumentId { get; set; }

/// <summary>
/// Gets or sets the original file name.
/// </summary>
public string FileName { get; set; }

/// <summary>
/// Gets or sets the document chunks with embeddings.
/// </summary>
public IList<ChatInteractionDocumentChunk> Chunks { get; set; } = [];
}
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,12 @@ public interface IAIChatSessionManager
/// Asynchronously creates a new AI chat session for the specified AI chat profile.
/// </summary>
/// <param name="profile">The AI chat profile for which the new session will be created. Must not be null.</param>
/// <param name="context"></param>
/// <returns>
/// A task representing the asynchronous operation. The task result is a new <see cref="AIChatSession"/>
/// associated with the provided profile.
/// </returns>
Task<AIChatSession> NewAsync(AIProfile profile);
Task<AIChatSession> NewAsync(AIProfile profile, NewAIChatSessionContext context);

/// <summary>
/// Asynchronously saves or updates the specified AI chat session.
Expand All @@ -44,4 +45,23 @@ public interface IAIChatSessionManager
/// A task representing the asynchronous operation. This method does not return any value.
/// </returns>
Task SaveAsync(AIChatSession chatSession);

/// <summary>
/// Asynchronously deletes the specified AI chat session.
/// </summary>
/// <param name="sessionId">The unique identifier of the chat session to delete. Must not be null or empty.</param>
/// <returns>
/// A task representing the asynchronous operation. The task result is <c>true</c> if the session was successfully deleted,
/// or <c>false</c> if the session was not found or could not be deleted.
/// </returns>
Task<bool> DeleteAsync(string sessionId);

/// <summary>
/// Asynchronously deletes all AI chat sessions for the specified profile and current user.
/// </summary>
/// <param name="profileId">The profile identifier to filter sessions. Must not be null or empty.</param>
/// <returns>
/// A task representing the asynchronous operation. The task result is the number of sessions that were deleted.
/// </returns>
Task<int> DeleteAllAsync(string profileId);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
using CrestApps.OrchardCore.AI.Models;

namespace CrestApps.OrchardCore.AI;

/// <summary>
/// Builds <see cref="AICompletionContext"/> instances from a given <see cref="AIProfile"/>.
/// </summary>
/// <remarks>
/// The default implementation seeds the context from the profile's metadata, then executes the
/// registered <see cref="IAICompletionContextBuilderHandler"/> pipeline in the following order:
///1) <see cref="IAICompletionContextBuilderHandler.BuildingAsync(AICompletionContextBuildingContext)"/>,
///2) the optional <paramref name="configure"/> delegate,
///3) <see cref="IAICompletionContextBuilderHandler.BuiltAsync(AICompletionContextBuiltContext)"/>.
/// </remarks>
public interface IAICompletionContextBuilder
{
/// <summary>
/// Creates and configures a new <see cref="AICompletionContext"/> based on the provided <paramref name="profile"/>.
/// </summary>
/// <param name="profile">The AI profile used to seed and configure the completion context. Must not be <see langword="null"/>.</param>
/// <param name="configure">An optional delegate to override or fine-tune the context after handlers have run <c>BuildingAsync</c> but before <c>BuiltAsync</c>.</param>
/// <returns>A task that completes with the fully built <see cref="AICompletionContext"/>.</returns>
/// <exception cref="ArgumentNullException">Thrown if <paramref name="profile"/> is <see langword="null"/>.</exception>
/// <seealso cref="IAICompletionContextBuilderHandler"/>
/// <seealso cref="AICompletionContextBuildingContext"/>
/// <seealso cref="AICompletionContextBuiltContext"/>
ValueTask<AICompletionContext> BuildAsync(AIProfile profile, Action<AICompletionContext> configure = null);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
using CrestApps.OrchardCore.AI.Models;

namespace CrestApps.OrchardCore.AI;

/// <summary>
/// Handles lifecycle events raised while building an <see cref="AICompletionContext"/>.
/// </summary>
/// <remarks>
/// Implementations can enrich, validate, or otherwise mutate the context. The builder will invoke
/// <see cref="BuildingAsync(AICompletionContextBuildingContext)"/> first, then apply any caller-provided
/// configuration, and finally invoke <see cref="BuiltAsync(AICompletionContextBuiltContext)"/>.
/// Handlers are resolved from DI and executed in reverse registration order to allow last-registered
/// handlers to run first.
/// </remarks>
public interface IAICompletionContextBuilderHandler
{
/// <summary>
/// Called while the <see cref="AICompletionContext"/> is being constructed, before the optional caller
/// configuration delegate is applied.
/// </summary>
/// <param name="context">Carries both the source <see cref="AIProfile"/> and the mutable <see cref="AICompletionContext"/>.</param>
/// <returns>A task that completes when the mutation or validation is done.</returns>
Task BuildingAsync(AICompletionContextBuildingContext context);

/// <summary>
/// Called after the context has been fully constructed and the optional caller configuration delegate
/// has been applied.
/// </summary>
/// <param name="context">Carries the final <see cref="AICompletionContext"/> along with the source <see cref="AIProfile"/>.</param>
/// <returns>A task that completes when post-build processing is done.</returns>
Task BuiltAsync(AICompletionContextBuiltContext context);
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

namespace CrestApps.OrchardCore.AI;

public interface IAIProfileManager : INamedCatalogManager<AIProfile>
public interface IAIProfileManager : INamedSourceCatalogManager<AIProfile>
{
/// <summary>
/// Asynchronously retrieves a collection of AI chat profiles of the specified type.
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
namespace CrestApps.OrchardCore.AI;

/// <summary>
/// Service for extracting text content from uploaded documents.
/// </summary>
public interface IDocumentTextExtractor
{
/// <summary>
/// Extracts text content from a document stream.
/// </summary>
/// <param name="stream">The document stream.</param>
/// <param name="fileName">The original file name with extension.</param>
/// <param name="fileExtension">The extension of the file.</param>
/// <param name="contentType">The content type of the file.</param>
/// <returns>The extracted text content.</returns>
Task<string> ExtractAsync(Stream stream, string fileName, string fileExtension, string contentType);
}
Loading