-
Notifications
You must be signed in to change notification settings - Fork 9
Add a way to upload-read Documents in chat. #229
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Co-authored-by: MikeAlhayek <[email protected]>
Co-authored-by: MikeAlhayek <[email protected]>
Co-authored-by: MikeAlhayek <[email protected]>
…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]>
There was a problem hiding this 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 |
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
CustomChatSession,CustomChatSessionDocuments, andCustomChatSessionDocumentEntrymodels to represent custom chat sessions and their associated documents. [1] [2]CustomChatCompletionContextfor passing custom chat session and document context to AI completion builders.AIChatInstanceMetadatato store user-configured settings for custom chat instances.Service Layer and Interfaces
IAICustomChatSessionManagerinterface and its implementationCustomChatSessionManagerfor managing custom chat sessions, including finding, saving, and deleting sessions. [1] [2]IAICompletionContextBuilderand 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
CustomChatSessionIndex) for efficient querying of custom chat sessions.ManageCustomChatInstancesfor controlling access to custom chat management features.Constants and Assets
Minor Refactoring
Microsoft.AspNetCore.Http.IHttpContextAccessorand 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.