Skip to content

Commit

Permalink
Reorganize modules and features and add Azure AI Inference (#44)
Browse files Browse the repository at this point in the history
  • Loading branch information
MikeAlhayek authored Feb 11, 2025
1 parent b80d59f commit 9ed2232
Show file tree
Hide file tree
Showing 222 changed files with 1,944 additions and 2,874 deletions.
35 changes: 21 additions & 14 deletions CrestApps.OrchardCore.sln
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,6 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CrestApps.OrchardCore.Abstr
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CrestApps.OrchardCore.Users.Abstractions", "src\Abstractions\CrestApps.OrchardCore.Users.Abstractions\CrestApps.OrchardCore.Users.Abstractions.csproj", "{CA041266-536F-4F0D-997C-BF64C32470EE}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CrestApps.OrchardCore.OpenAI.Azure", "src\Modules\CrestApps.OrchardCore.OpenAI.Azure\CrestApps.OrchardCore.OpenAI.Azure.csproj", "{0EA43AC1-F54F-40ED-9A78-9264C91FAD09}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CrestApps.OrchardCore.OpenAI.Azure.Core", "src\Core\CrestApps.OrchardCore.OpenAI.Azure.Core\CrestApps.OrchardCore.OpenAI.Azure.Core.csproj", "{11343335-78D8-4A0D-8132-8EAB70810741}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CrestApps.OrchardCore.OpenAI.Core", "src\Core\CrestApps.OrchardCore.OpenAI.Core\CrestApps.OrchardCore.OpenAI.Core.csproj", "{A273AC38-86C8-4C84-9D2A-EBB11FCB2863}"
Expand All @@ -59,10 +57,14 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CrestApps.OrchardCore.DeepS
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CrestApps.OrchardCore.DeepSeek.Core", "src\Core\CrestApps.OrchardCore.DeepSeek.Core\CrestApps.OrchardCore.DeepSeek.Core.csproj", "{F3F54A48-8A8E-4E97-92BA-B912A6A4C8BC}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CrestApps.OrchardCore.AI.Ollama", "src\Modules\CrestApps.OrchardCore.AI.Ollama\CrestApps.OrchardCore.AI.Ollama.csproj", "{BA3057FF-D087-409A-8440-8A9CA925CE22}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CrestApps.Aspire.AppHost", "src\Startup\CrestApps.Aspire.AppHost\CrestApps.Aspire.AppHost.csproj", "{8125DD99-54A3-4F6D-8FFF-E7F121F9A36F}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CrestApps.OrchardCore.OpenAI.Azure", "src\Modules\CrestApps.OrchardCore.OpenAI.Azure\CrestApps.OrchardCore.OpenAI.Azure.csproj", "{A150B068-E1A5-46BA-B77F-72A5013ABC29}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CrestApps.OrchardCore.AzureAIInference", "src\Modules\CrestApps.OrchardCore.AzureAIInference\CrestApps.OrchardCore.AzureAIInference.csproj", "{0A5DE869-61E1-4AF8-A083-F1A313558F78}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CrestApps.OrchardCore.Ollama", "src\Modules\CrestApps.OrchardCore.Ollama\CrestApps.OrchardCore.Ollama.csproj", "{00A868B3-8906-45D9-A841-AC96FD9DEAAF}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -97,10 +99,6 @@ Global
{CA041266-536F-4F0D-997C-BF64C32470EE}.Debug|Any CPU.Build.0 = Debug|Any CPU
{CA041266-536F-4F0D-997C-BF64C32470EE}.Release|Any CPU.ActiveCfg = Release|Any CPU
{CA041266-536F-4F0D-997C-BF64C32470EE}.Release|Any CPU.Build.0 = Release|Any CPU
{0EA43AC1-F54F-40ED-9A78-9264C91FAD09}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{0EA43AC1-F54F-40ED-9A78-9264C91FAD09}.Debug|Any CPU.Build.0 = Debug|Any CPU
{0EA43AC1-F54F-40ED-9A78-9264C91FAD09}.Release|Any CPU.ActiveCfg = Release|Any CPU
{0EA43AC1-F54F-40ED-9A78-9264C91FAD09}.Release|Any CPU.Build.0 = Release|Any CPU
{11343335-78D8-4A0D-8132-8EAB70810741}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{11343335-78D8-4A0D-8132-8EAB70810741}.Debug|Any CPU.Build.0 = Debug|Any CPU
{11343335-78D8-4A0D-8132-8EAB70810741}.Release|Any CPU.ActiveCfg = Release|Any CPU
Expand Down Expand Up @@ -137,14 +135,22 @@ Global
{F3F54A48-8A8E-4E97-92BA-B912A6A4C8BC}.Debug|Any CPU.Build.0 = Debug|Any CPU
{F3F54A48-8A8E-4E97-92BA-B912A6A4C8BC}.Release|Any CPU.ActiveCfg = Release|Any CPU
{F3F54A48-8A8E-4E97-92BA-B912A6A4C8BC}.Release|Any CPU.Build.0 = Release|Any CPU
{BA3057FF-D087-409A-8440-8A9CA925CE22}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{BA3057FF-D087-409A-8440-8A9CA925CE22}.Debug|Any CPU.Build.0 = Debug|Any CPU
{BA3057FF-D087-409A-8440-8A9CA925CE22}.Release|Any CPU.ActiveCfg = Release|Any CPU
{BA3057FF-D087-409A-8440-8A9CA925CE22}.Release|Any CPU.Build.0 = Release|Any CPU
{8125DD99-54A3-4F6D-8FFF-E7F121F9A36F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{8125DD99-54A3-4F6D-8FFF-E7F121F9A36F}.Debug|Any CPU.Build.0 = Debug|Any CPU
{8125DD99-54A3-4F6D-8FFF-E7F121F9A36F}.Release|Any CPU.ActiveCfg = Release|Any CPU
{8125DD99-54A3-4F6D-8FFF-E7F121F9A36F}.Release|Any CPU.Build.0 = Release|Any CPU
{A150B068-E1A5-46BA-B77F-72A5013ABC29}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{A150B068-E1A5-46BA-B77F-72A5013ABC29}.Debug|Any CPU.Build.0 = Debug|Any CPU
{A150B068-E1A5-46BA-B77F-72A5013ABC29}.Release|Any CPU.ActiveCfg = Release|Any CPU
{A150B068-E1A5-46BA-B77F-72A5013ABC29}.Release|Any CPU.Build.0 = Release|Any CPU
{0A5DE869-61E1-4AF8-A083-F1A313558F78}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{0A5DE869-61E1-4AF8-A083-F1A313558F78}.Debug|Any CPU.Build.0 = Debug|Any CPU
{0A5DE869-61E1-4AF8-A083-F1A313558F78}.Release|Any CPU.ActiveCfg = Release|Any CPU
{0A5DE869-61E1-4AF8-A083-F1A313558F78}.Release|Any CPU.Build.0 = Release|Any CPU
{00A868B3-8906-45D9-A841-AC96FD9DEAAF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{00A868B3-8906-45D9-A841-AC96FD9DEAAF}.Debug|Any CPU.Build.0 = Debug|Any CPU
{00A868B3-8906-45D9-A841-AC96FD9DEAAF}.Release|Any CPU.ActiveCfg = Release|Any CPU
{00A868B3-8906-45D9-A841-AC96FD9DEAAF}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand All @@ -157,7 +163,6 @@ Global
{DD1D0B6E-2671-47C8-B763-FAEF0DA5DFFA} = {447572DA-8B6F-49E6-84C9-28FFF3B71CF5}
{9F0DAAAA-16BD-4CC2-A279-77387A7CFE41} = {94189A7B-38B7-4331-B711-E5DCCEAFE737}
{CA041266-536F-4F0D-997C-BF64C32470EE} = {94189A7B-38B7-4331-B711-E5DCCEAFE737}
{0EA43AC1-F54F-40ED-9A78-9264C91FAD09} = {C8D22F16-3D2B-4053-B0D5-A1F5EA5A91C2}
{11343335-78D8-4A0D-8132-8EAB70810741} = {EC2B9CAB-56C8-4421-ACA2-43C09B71DAB5}
{A273AC38-86C8-4C84-9D2A-EBB11FCB2863} = {EC2B9CAB-56C8-4421-ACA2-43C09B71DAB5}
{737B1434-403D-4FAE-A9BD-0B0022A0BB53} = {C8D22F16-3D2B-4053-B0D5-A1F5EA5A91C2}
Expand All @@ -167,8 +172,10 @@ Global
{676961EB-5AEC-412A-8993-A8F36D63E1C6} = {C8D22F16-3D2B-4053-B0D5-A1F5EA5A91C2}
{F8078180-9D56-46CF-9914-E78CA5EB1CFF} = {C8D22F16-3D2B-4053-B0D5-A1F5EA5A91C2}
{F3F54A48-8A8E-4E97-92BA-B912A6A4C8BC} = {EC2B9CAB-56C8-4421-ACA2-43C09B71DAB5}
{BA3057FF-D087-409A-8440-8A9CA925CE22} = {C8D22F16-3D2B-4053-B0D5-A1F5EA5A91C2}
{8125DD99-54A3-4F6D-8FFF-E7F121F9A36F} = {447572DA-8B6F-49E6-84C9-28FFF3B71CF5}
{A150B068-E1A5-46BA-B77F-72A5013ABC29} = {C8D22F16-3D2B-4053-B0D5-A1F5EA5A91C2}
{0A5DE869-61E1-4AF8-A083-F1A313558F78} = {C8D22F16-3D2B-4053-B0D5-A1F5EA5A91C2}
{00A868B3-8906-45D9-A841-AC96FD9DEAAF} = {C8D22F16-3D2B-4053-B0D5-A1F5EA5A91C2}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {0E9F9B00-7078-4EA8-87A9-0B2E74375F1E}
Expand Down
1 change: 1 addition & 0 deletions Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
<PackageVersion Include="Microsoft.Extensions.AI.Abstractions" Version="9.1.0-preview.1.25064.3" />
<PackageVersion Include="Microsoft.Extensions.AI.Ollama" Version="9.1.0-preview.1.25064.3" />
<PackageVersion Include="Microsoft.Extensions.AI.OpenAI" Version="9.1.0-preview.1.25064.3" />
<PackageVersion Include="Microsoft.Extensions.AI.AzureAIInference" Version="9.1.0-preview.1.25064.3" />
</ItemGroup>

<ItemGroup>
Expand Down
11 changes: 10 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,16 @@ To get started with any module, refer to its respective `README.md` file for det
Enhances user management with customizable display names and avatars. See the [Users Module README](src/Modules/CrestApps.OrchardCore.Users/README.md) for details.

### AI Module
Provides a user-friendly interface for interacting with AI models like **ChatGPT**. See the [AI Module README](src/Modules/CrestApps.OrchardCore.AI/README.md) for more details.
Provides services and interface for interacting with AI models like **ChatGPT**. See the [AI Module README](src/Modules/CrestApps.OrchardCore.AI/README.md) for more details.

### Ollama Module
Extends the **AI Module** by integrating any Ollama model. See the [OpenAI Module README](src/Modules/CrestApps.OrchardCore.Ollama/README.md).

### Azure AI Inference Module
Extends the **AI Module** by integrating Azure AI Inference services. See the [OpenAI Module README](src/Modules/CrestApps.OrchardCore.AzureAIInference/README.md).

### DeepSeek Module
Extends the **AI Module** by integrating DeepSeek services. See the [OpenAI Module README](src/Modules/CrestApps.OrchardCore.DeepSeek/README.md).

### OpenAI Module
Extends the **AI Module** by integrating OpenAI-powered services. See the [OpenAI Module README](src/Modules/CrestApps.OrchardCore.OpenAI/README.md).
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

namespace CrestApps.OrchardCore.AI;

public static class AIChatProfileStoreExtensions
public static class AIProfileStoreExtensions
{
public static async ValueTask<IEnumerable<AIChatProfile>> GetProfilesAsync(this IAIChatProfileStore store, AIChatProfileType type)
public static async ValueTask<IEnumerable<AIProfile>> GetProfilesAsync(this IAIProfileStore store, AIProfileType type)
{
var profiles = await store.GetAllAsync();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public interface IAIChatSessionManager
/// A task representing the asynchronous operation. The task result is a new <see cref="AIChatSession"/>
/// associated with the provided profile.
/// </returns>
Task<AIChatSession> NewAsync(AIChatProfile profile);
Task<AIChatSession> NewAsync(AIProfile profile);

/// <summary>
/// Asynchronously saves or updates the specified AI chat session.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

namespace CrestApps.OrchardCore.AI;

public interface IAIChatCompletionService
public interface IAICompletionService
{
/// <summary>
/// Gets the unique technical name of the chat completion service implementation.
Expand All @@ -19,5 +19,5 @@ public interface IAIChatCompletionService
/// <param name="messages">A collection of messages that are part of the chat conversation.</param>
/// <param name="context">The context that may provide additional parameters or configurations for the chat request.</param>
/// <returns>A task representing the asynchronous operation, with the completion response as the result.</returns>
Task<AIChatCompletionResponse> ChatAsync(IEnumerable<ChatMessage> messages, AIChatCompletionContext context, CancellationToken cancellationToken = default);
Task<ChatCompletion> ChatAsync(IEnumerable<ChatMessage> messages, AICompletionContext context, CancellationToken cancellationToken = default);
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,71 +2,71 @@

namespace CrestApps.OrchardCore.AI;

public interface IAIChatProfileHandler
public interface IAIProfileHandler
{
/// <summary>
/// This method in invoked during profile initializing.
/// </summary>
/// <param name="context">An instance of <see cref="InitializingAIChatProfileContext"/>.</param>
Task InitializingAsync(InitializingAIChatProfileContext context);
/// <param name="context">An instance of <see cref="InitializingAIProfileContext"/>.</param>
Task InitializingAsync(InitializingAIProfileContext context);

/// <summary>
/// This method in invoked after the profile was initialized.
/// </summary>
/// <param name="context">An instance of <see cref="InitializedAIChatProfileContext"/>.</param>
Task InitializedAsync(InitializedAIChatProfileContext context);
/// <param name="context">An instance of <see cref="InitializedAIProfileContext"/>.</param>
Task InitializedAsync(InitializedAIProfileContext context);

/// <summary>
/// This method in invoked after the profile was loaded from the store.
/// </summary>
/// <param name="context">An instance of <see cref="LoadedAIChatProfileContext"/>.</param>
Task LoadedAsync(LoadedAIChatProfileContext context);
/// <param name="context">An instance of <see cref="LoadedAIProfileContext"/>.</param>
Task LoadedAsync(LoadedAIProfileContext context);

/// <summary>
/// This method in invoked during profile validating.
/// </summary>
/// <param name="context">An instance of <see cref="ValidatingAIChatProfileContext"/>.</param>
Task ValidatingAsync(ValidatingAIChatProfileContext context);
/// <param name="context">An instance of <see cref="ValidatingAIProfileContext"/>.</param>
Task ValidatingAsync(ValidatingAIProfileContext context);

/// <summary>
/// This method in invoked after the profile was validated.
/// </summary>
/// <param name="context">An instance of <see cref="ValidatedAIChatProfileContext"/>.</param>
Task ValidatedAsync(ValidatedAIChatProfileContext context);
/// <param name="context">An instance of <see cref="ValidatedAIProfileContext"/>.</param>
Task ValidatedAsync(ValidatedAIProfileContext context);

/// <summary>
/// This method in invoked during profile removing.
/// </summary>
/// <param name="context">An instance of <see cref="DeletingAIChatProfileContext"/>.</param>
Task DeletingAsync(DeletingAIChatProfileContext context);
/// <param name="context">An instance of <see cref="DeletingAIProfileContext"/>.</param>
Task DeletingAsync(DeletingAIProfileContext context);

/// <summary>
/// This method in invoked after the profile was removed.
/// </summary>
/// <param name="context">An instance of <see cref="DeletedAIChatProfileContext"/>.</param>
Task DeletedAsync(DeletedAIChatProfileContext context);
/// <param name="context">An instance of <see cref="DeletedAIProfileContext"/>.</param>
Task DeletedAsync(DeletedAIProfileContext context);

/// <summary>
/// This method in invoked during profile updating.
/// </summary>
/// <param name="context">An instance of <see cref="UpdatingAIChatProfileContext"/>.</param>
Task UpdatingAsync(UpdatingAIChatProfileContext context);
/// <param name="context">An instance of <see cref="UpdatingAIProfileContext"/>.</param>
Task UpdatingAsync(UpdatingAIProfileContext context);

/// <summary>
/// This method in invoked after the profile was updated.
/// </summary>
/// <param name="context">An instance of <see cref="UpdatedAIChatProfileContext"/>.</param>
Task UpdatedAsync(UpdatedAIChatProfileContext context);
/// <param name="context">An instance of <see cref="UpdatedAIProfileContext"/>.</param>
Task UpdatedAsync(UpdatedAIProfileContext context);

/// <summary>
/// This method in invoked during profile saving.
/// </summary>
/// <param name="context">An instance of <see cref="SavingAIChatProfileContext"/>.</param>
Task SavingAsync(SavingAIChatProfileContext context);
/// <param name="context">An instance of <see cref="SavingAIProfileContext"/>.</param>
Task SavingAsync(SavingAIProfileContext context);

/// <summary>
/// This method in invoked after the profile was saved.
/// </summary>
/// <param name="context">An instance of <see cref="SavedAIChatProfileContext"/>.</param>
Task SavedAsync(SavedAIChatProfileContext context);
/// <param name="context">An instance of <see cref="SavedAIProfileContext"/>.</param>
Task SavedAsync(SavedAIProfileContext context);
}
Loading

0 comments on commit 9ed2232

Please sign in to comment.