How edgett/palmhill.blazorchat works
• Frontend (Client):
• Blazor WebAssembly project located under PalmHill.BlazorChat/Client.
• Components such as UI pages (Index.razor, Error.razor), layouts (MainLayout.razor), and various UI components (chat messaging, attachments, markdown viewers, chat settings).
• That this layer is responsible for invoking services (AttachmentService, ChatService, ThemeService, WebSocketChatService, etc.), handling user input, and rendering the chat experience.
• Backend (Server):
• Server-side logic within PalmHill.BlazorChat/Server.
• Two primary sub-components:
a. WebAPI Controllers (ApiChatController, AttachmentController) for RESTful interactions.
b. SignalR hub components (CustomUserIdProvider, WebSocketChat) for real-time chat messaging.
• Supporting files like configuration (appsettings.json) and any error-handling or threading components (SerialExecutionAspect, ChatCancellation).
• Language Model Integration (Llama):
• That this module wraps around LlamaSharp and is utilized to perform inference for chat responses and document embeddings.
• Mention that configuration for the model (e.g., ModelConfig, language model file paths set in the server’s appsettings.json) is handled here.
• Shared Components & API Client:
• Shared project (PalmHill.BlazorChat/Shared) that contains common utilities and model definitions shared between client and server.
• ApiClient (PalmHill.BlazorChat.ApiClient) that likely provides interface definitions (WebApiInterface) for interacting with the server’s API.
Relationships and Data Flows
• Data Flow from Frontend to Backend:
• Backend Processing and Model Integration:
• That once a chat message is processed, the Server might interact with the Llama component for inference tasks.
• Optionally, highlight the involvement of Microsoft’s Semantic Kernel if needed for advanced functionalities (document retrieval, embedding).
• Shared Data Models:
• Similarly, connect the ApiClient to the WebAPI and Shared projects illustrating API consumption via defined interfaces.
Architectural Patterns and Technologies
• Optionally, include configuration details such as the appsettings.json location and its role in defining model paths and logging configuration.