Table of Contents

Class AIRunServiceExtensions

Namespace
Mythosia.AI.Extensions
Assembly
Mythosia.AI.Abstractions.dll

Access to optional run support through an IAIService reference.

public static class AIRunServiceExtensions
Inheritance
AIRunServiceExtensions
Inherited Members

Methods

StartRunAsync(IAIService, Message, Action<string>?, StreamOptions?, AIRequestContext?, CancellationToken)

Starts a message run, or rejects a service that does not implement IAIRunService.

public static Task<AIRun> StartRunAsync(this IAIService service, Message message, Action<string>? onText = null, StreamOptions? options = null, AIRequestContext? context = null, CancellationToken cancellationToken = default)

Parameters

service IAIService
message Message
onText Action<string>
options StreamOptions
context AIRequestContext
cancellationToken CancellationToken

Returns

Task<AIRun>

StartRunAsync(IAIService, string, Action<string>?, StreamOptions?, AIRequestContext?, CancellationToken)

Starts a run, or rejects a service that does not implement IAIRunService.

public static Task<AIRun> StartRunAsync(this IAIService service, string prompt, Action<string>? onText = null, StreamOptions? options = null, AIRequestContext? context = null, CancellationToken cancellationToken = default)

Parameters

service IAIService
prompt string
onText Action<string>
options StreamOptions
context AIRequestContext
cancellationToken CancellationToken

Returns

Task<AIRun>