Class GenerativeControllerBase<TDelta, TOutput, TService, TSettings>
Base class for generative controllers (TTS, STT, Image) that support both REST and Streaming modes. Provides common infrastructure for service management and error handling.
Inheritance
GenerativeControllerBase<TDelta, TOutput, TService, TSettings>
Implements
IStreamVisitor<TDelta, Generated<TOutput>>
Inherited Members
Namespace: Glitch9.AIDevKit.Agents
Assembly: Glitch9.AIDevKit.dll
Syntax
public abstract class GenerativeControllerBase<TDelta, TOutput, TService, TSettings> : IStreamVisitor<TDelta, Generated<TOutput>> where TOutput : class where TService : class where TSettings : class
Type Parameters
| Name | Description |
|---|---|
| TDelta | The delta type for streaming updates |
| TOutput | The final output type |
| TService | The base service interface type |
| TSettings | The settings type |
Fields
| Edit this page View Sourcem_Service
Declaration
protected readonly TService m_Service
Field Value
| Type | Description |
|---|---|
| TService |
m_Settings
Declaration
protected readonly TSettings m_Settings
Field Value
| Type | Description |
|---|---|
| TSettings |
Methods
| Edit this page View SourceOnComplete(Generated<TOutput>)
Handle completion of generation. Must be implemented by derived classes.
Declaration
public abstract void OnComplete(Generated<TOutput> result)
Parameters
| Type | Name | Description |
|---|---|---|
| Generated<TOutput> | result |
OnDelta(TDelta)
Handle streaming delta updates. Must be implemented by derived classes.
Declaration
public abstract void OnDelta(TDelta delta)
Parameters
| Type | Name | Description |
|---|---|---|
| TDelta | delta |
OnError(Exception)
Handle errors during generation. Default implementation dispatches to agent control.
Declaration
public virtual void OnError(Exception error)
Parameters
| Type | Name | Description |
|---|---|---|
| Exception | error |