Table of Contents

Class InteractiveService

Namespace
AutoGen.DotnetInteractive
Assembly
AutoGen.DotnetInteractive.dll
public class InteractiveService : IDisposable
Inheritance
InteractiveService
Implements
Inherited Members

Constructors

InteractiveService(Kernel)

Create an instance of InteractiveService with a running kernel. When using this constructor, you don't need to call StartAsync(string, CancellationToken) to start the kernel.

public InteractiveService(Kernel kernel)

Parameters

kernel Kernel

InteractiveService(string)

Install dotnet interactive tool to installingDirectory and create an instance of InteractiveService.

When using this constructor, you need to call StartAsync(string, CancellationToken) to install dotnet interactive tool and start the kernel.

public InteractiveService(string installingDirectory)

Parameters

installingDirectory string

dotnet interactive installing directory

Properties

Kernel

public Kernel? Kernel { get; }

Property Value

Kernel

Methods

Dispose()

public void Dispose()

Dispose(bool)

protected virtual void Dispose(bool disposing)

Parameters

disposing bool

IsRunning()

public bool IsRunning()

Returns

bool

RestoreDotnetInteractive()

public bool RestoreDotnetInteractive()

Returns

bool

StartAsync(string, CancellationToken)

public Task<bool> StartAsync(string workingDirectory, CancellationToken ct = default)

Parameters

workingDirectory string
ct CancellationToken

Returns

Task<bool>

SubmitCSharpCodeAsync(string, CancellationToken)

public Task<string?> SubmitCSharpCodeAsync(string code, CancellationToken ct)

Parameters

code string
ct CancellationToken

Returns

Task<string>

SubmitCommandAsync(SubmitCode, CancellationToken)

public Task<string?> SubmitCommandAsync(SubmitCode cmd, CancellationToken ct)

Parameters

cmd SubmitCode
ct CancellationToken

Returns

Task<string>

SubmitPowershellCodeAsync(string, CancellationToken)

public Task<string?> SubmitPowershellCodeAsync(string code, CancellationToken ct)

Parameters

code string
ct CancellationToken

Returns

Task<string>