Skip to content

Conversation

@JackTelford
Copy link
Contributor

@JackTelford JackTelford commented Dec 8, 2025

This pull request introduces support for "Custom Chat" instances within the AI module, enabling users to create, manage, and interact with chat sessions that use user-configured settings and uploaded documents as context. The changes include new models, interfaces, services, permissions, and supporting infrastructure for custom chat functionality.

Key changes:

Custom Chat Models and Context

  • Added CustomChatSession, CustomChatSessionDocuments, and CustomChatSessionDocumentEntry models to represent custom chat sessions and their associated documents. [1] [2]
  • Introduced CustomChatCompletionContext for passing custom chat session and document context to AI completion builders.
  • Added AIChatInstanceMetadata to store user-configured settings for custom chat instances.

Service Layer and Interfaces

  • Created the IAICustomChatSessionManager interface and its implementation CustomChatSessionManager for managing custom chat sessions, including finding, saving, and deleting sessions. [1] [2]
  • Updated IAICompletionContextBuilder and its implementation to support building AI completion contexts from custom chat sessions and their metadata, including injecting uploaded document content into the system message. [1] [2]

Infrastructure and Permissions

  • Added a new YesSql index (CustomChatSessionIndex) for efficient querying of custom chat sessions.
  • Registered new services and project dependencies for custom chat support. [1] [2]
  • Introduced a new permission ManageCustomChatInstances for controlling access to custom chat management features.

Constants and Assets

  • Added new feature and route constants for custom chat functionality. [1] [2]
  • Included a new JavaScript asset bundle for custom chat UI support.

Minor Refactoring

  • Standardized usage of Microsoft.AspNetCore.Http.IHttpContextAccessor and improved code consistency in session management services. [1] [2] [3]

These changes lay the foundation for flexible, user-driven AI chat experiences with support for custom context and document uploads.

Copilot AI and others added 13 commits October 29, 2025 19:34
…nces

- Fixed missing form closure causing "Create Instance" button failure
- Simplified title display logic now that title is required
- Removed "Untitled" fallback since title field has [Required] attribute
- Pass full configuration model to new instance form

Co-authored-by: MikeAlhayek <[email protected]>
…oller

- Separated Index, Create, and Edit actions/views following ProfilesController pattern
- Created CustomChatInstanceConfigurationDisplayDriver for display/edit logic
- Removed sidebar from create/edit views - now separate Index page lists all instances
- Index view has "Create Instance" button, instances displayed in list with edit/delete actions
- Create and Edit views use simple forms with DisplayManager shapes
- Simplified controller - removed all form building logic, delegated to display driver
- DisplayDriver handles all configuration population and validation
- Much cleaner separation of concerns and extensibility via drivers

Co-authored-by: MikeAlhayek <[email protected]>
@JackTelford JackTelford changed the title JT-AIDocument-Reader Add a way to read a Document in chat. Dec 8, 2025
@JackTelford JackTelford changed the title Add a way to read a Document in chat. Add a way to upload&read Documents in chat. Dec 8, 2025
@JackTelford JackTelford changed the title Add a way to upload&read Documents in chat. Add a way to upload-read Documents in chat. Dec 8, 2025
Copilot AI review requested due to automatic review settings December 29, 2025 17:51
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request introduces support for user-configurable custom AI chat instances, enabling users to create and manage personalized chat sessions with custom AI settings independently of predefined AI profiles. The feature adds comprehensive CRUD operations, database models, permissions, SignalR hub integration, and a Vue.js-based frontend for managing these custom chat instances.

Key Changes

  • New custom chat management system: Users can create, edit, and delete custom chat instances with configurable AI parameters (temperature, tokens, tools, etc.)
  • Database layer: New models (CustomChatSession, AIChatInstanceMetadata), indexes, and migrations to support custom chat instances scoped to individual users
  • Frontend components: Vue.js-based chat interface with SignalR streaming, asset pipeline configuration, and admin UI views for CRUD operations

Reviewed changes

Copilot reviewed 47 out of 48 changed files in this pull request and generated 16 comments.

Show a summary per file
File Description
src/Modules/CrestApps.OrchardCore.AI/Startup.cs Registers custom chat session index providers and migrations
src/Modules/CrestApps.OrchardCore.AI/Services/AIPermissionsProvider.cs Adds ManageCustomChatInstances permission
src/Modules/CrestApps.OrchardCore.AI/Migrations/CustomChatSessionIndexMigrations.cs Creates database indexes for custom chat sessions
src/Modules/CrestApps.OrchardCore.AI/Indexes/CustomChatSessionIndexProvider.cs Maps CustomChatSession to database indexes
src/Modules/CrestApps.OrchardCore.AI.Chat/Controllers/CustomChatSettingsController.cs Implements CRUD operations for custom chat instances with authorization
src/Modules/CrestApps.OrchardCore.AI.Chat/Hubs/CustomChatHub.cs SignalR hub for real-time streaming chat with custom instances
src/Modules/CrestApps.OrchardCore.AI.Chat/Drivers/CustomChatDisplayDriver.cs Display driver for rendering and editing custom chat configuration
src/Modules/CrestApps.OrchardCore.AI.Chat/Models/CustomChatPart.cs Content part storing custom chat configuration properties
src/Modules/CrestApps.OrchardCore.AI.Chat/ViewModels/CustomChatViewModel.cs View model for custom chat configuration with validation
src/Modules/CrestApps.OrchardCore.AI.Chat/Assets/js/custom-chat.js Vue.js application managing chat UI and SignalR communication
src/Modules/CrestApps.OrchardCore.AI.Chat/Views/*.cshtml Razor views for listing, creating, editing custom chat instances and chat UI
src/Core/CrestApps.OrchardCore.AI.Core/Services/DefaultAICompletionContextBuilder.cs Adds BuildCustomAsync method for custom chat completion contexts
src/Core/CrestApps.OrchardCore.AI.Core/Services/CustomChatSessionManager.cs Service for managing custom chat session lifecycle and queries
src/Core/CrestApps.OrchardCore.AI.Core/Models/AIChatInstanceMetadata.cs Metadata model for custom chat instance configuration
src/Abstractions/CrestApps.OrchardCore.AI.Abstractions/Models/CustomChatSession.cs Domain model representing a custom chat session
src/Abstractions/CrestApps.OrchardCore.AI.Abstractions/IAICustomChatSessionManager.cs Interface for custom chat session management operations

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants