AugusteVN.Modules.VirtualAssistant._Shared.Spa 1.0.2

dotnet add package AugusteVN.Modules.VirtualAssistant._Shared.Spa --version 1.0.2
                    
NuGet\Install-Package AugusteVN.Modules.VirtualAssistant._Shared.Spa -Version 1.0.2
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="AugusteVN.Modules.VirtualAssistant._Shared.Spa" Version="1.0.2" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="AugusteVN.Modules.VirtualAssistant._Shared.Spa" Version="1.0.2" />
                    
Directory.Packages.props
<PackageReference Include="AugusteVN.Modules.VirtualAssistant._Shared.Spa" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add AugusteVN.Modules.VirtualAssistant._Shared.Spa --version 1.0.2
                    
#r "nuget: AugusteVN.Modules.VirtualAssistant._Shared.Spa, 1.0.2"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package AugusteVN.Modules.VirtualAssistant._Shared.Spa@1.0.2
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=AugusteVN.Modules.VirtualAssistant._Shared.Spa&version=1.0.2
                    
Install as a Cake Addin
#tool nuget:?package=AugusteVN.Modules.VirtualAssistant._Shared.Spa&version=1.0.2
                    
Install as a Cake Tool

AugusteVN.Modules.VirtualAssistant._Shared.Spa

Blazor components, state management, and Ollama HTTP client for the VirtualAssistant module — provides a full chat-style interface for local LLM inference.

Part of the AugusteVN Modules collection.

Overview

This is a client-side-only module with no server-side Api, Database, or Features projects. It integrates directly with a local Ollama instance via AugusteVN.Ollama.Client for real-time streaming text generation.

Extension Method

AddVirtualAssistantSharedSpa(this IServiceCollection, IConfiguration)

Registers the VirtualAssistant SPA layer:

  • OllamaClientConfig — Binds configuration from appsettings.json via IOptions<OllamaClientConfig>
  • HttpClient — Standard IHttpClientFactory registration
  • VirtualAssistantState — Scoped reactive state provider (extends StateProvider with PersistentComponentState)
  • OllamaHttpClient — Scoped Ollama API client from AugusteVN.Ollama.Client
  • IVirtualAssistantClient — Scoped as VirtualAssistantHttpClient, the module's primary client abstraction
// Program.cs
builder.Services.AddVirtualAssistantSharedSpa(builder.Configuration);

Dependencies

  • AugusteVN.Ollama.Client — Ollama REST API client for model listing and text generation

Services

VirtualAssistantState

Reactive state provider (StateProvider) with PersistentComponentState support for server prerendering:

Property Type Description
Models List<ModelResponse>? Cached list of locally available Ollama models
Response GenerateResponse? Current/latest response (notifies on change)
ResponseHistory List<GenerateResponse> Full history of all generated responses
SelectedResponse GenerateResponse? Currently selected response from history (notifies on change)
ResponsePreview string? HTML preview of the current response (Markdown converted)
SelectedModel string? Currently selected model name
HostUrl string? Current Ollama host URL
IsPreviewModeOn bool Toggle for Markdown preview mode (notifies on change)

Methods:

  • SetSelectedResponse(GenerateResponse) — Sets both SelectedResponse and Response simultaneously

IVirtualAssistantClient

Abstraction for the VirtualAssistant HTTP operations:

Method Description
GetModelsAsync(hostUrl) Fetches locally available Ollama models
GenerateResponseAsync(request) Streams a text generation response

VirtualAssistantHttpClient

Implementation of IVirtualAssistantClient backed by OllamaHttpClient:

  • GetModelsAsync — Calls ListLocalModelsAsync on the Ollama client, caches results in state keyed by HostUrl
  • GenerateResponseAsync — Streams generation via OllamaGenerateRequest, accumulates tokens into GenerateResponse.Response, captures Context and CompletedAt on completion, and appends to ResponseHistory

OllamaHttpClient

Direct Ollama REST API client from AugusteVN.Ollama.Client, registered as a scoped service.

Components

VirtualAssistantPromptForm

Full prompt submission form with:

  • Host URL input with blur-triggered model list loading
  • Default host URL shortcut (http://localhost:11434)
  • Model selector dropdown (populated from Ollama local models)
  • Prompt textarea with full-screen toggle
  • Preview mode on/off switch
  • FluentValidation integration
  • Submit button disabled during generation or when required fields are empty
Parameter Type Description
IsFullScreen bool Whether to render in expanded full-screen mode

VirtualAssistantPreview

Reactive Markdown-to-HTML response preview. Listens to VirtualAssistantState changes and renders the response as:

  • Edit mode — Raw Markdown in a <textarea> for editing
  • Preview mode — HTML rendered via Markdown.ToHtml with Prism.js syntax highlighting

Toggles visibility based on State.IsPreviewModeOn.

Parameter Type Description
IsFullScreen bool Whether to render with expanded height

VirtualAssistantStateChangeListener

Internal component that bridges INotifyPropertyChanged events from VirtualAssistantState to Blazor's rendering lifecycle. Listens for Response and IsPreviewModeOn property changes and invokes OnPreviewChanged.

VirtualAssistantPromptHistory

Renders the full response history as a scrollable list with:

  • Prompt text (truncated) and completion timestamp for each response
  • Click to select and view a previous response
  • Copy to clipboard button (copies prompt + response)
  • Download as Markdown file button (generates .md file with slugified filename)

Registration

// Program.cs
builder.Services.AddVirtualAssistantSharedSpa(builder.Configuration);

Configuration

{
  "OllamaClientConfig": {
    "BaseUrl": "http://localhost:11434"
  }
}

Installation

dotnet add package AugusteVN.Modules.VirtualAssistant._Shared.Spa

Full Documentation

See the VirtualAssistant Module README for complete documentation.

Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.2 84 8/8/2026
1.0.1 73 8/8/2026
1.0.0 83 8/8/2026