Table of Contents

Class ServingProgramExecutionEngine

Namespace
AiDotNet.ProgramSynthesis.Serving
Assembly
AiDotNet.dll

Program execution engine that delegates sandboxed execution to an AiDotNet.Serving instance.

public sealed class ServingProgramExecutionEngine : IProgramExecutionEngine
Inheritance
ServingProgramExecutionEngine
Implements
Inherited Members

Constructors

ServingProgramExecutionEngine(IProgramSynthesisServingClient)

public ServingProgramExecutionEngine(IProgramSynthesisServingClient client)

Parameters

client IProgramSynthesisServingClient

ServingProgramExecutionEngine(IProgramSynthesisServingClient, TimeSpan)

public ServingProgramExecutionEngine(IProgramSynthesisServingClient client, TimeSpan timeout)

Parameters

client IProgramSynthesisServingClient
timeout TimeSpan

Methods

TryExecute(ProgramLanguage, string, string, out string, out string?, CancellationToken)

Tries to execute the given program source against the provided input.

public bool TryExecute(ProgramLanguage language, string sourceCode, string input, out string output, out string? errorMessage, CancellationToken cancellationToken = default)

Parameters

language ProgramLanguage

The programming language the source is written in.

sourceCode string

The program source code.

input string

The input to execute the program with.

output string

The captured output produced by the program (if successful).

errorMessage string

An optional error message if execution failed.

cancellationToken CancellationToken

Optional cancellation token for the execution attempt.

Returns

bool

True if execution succeeded and output is available; otherwise, false.