# OfficeAiEngine

Bounded document operations over a caller-supplied model executor.

Class 

`OfficeIMO.AI`

**Namespace**

`OfficeIMO.AI`

**Assembly**

`OfficeIMO.AI`

**Source revision**

`ba882f6b0d07` with working tree changes

**Source**

[OfficeAiEngine.cs:15](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.AI/OfficeAiEngine.cs#L15)

**Modifiers**

sealed

Bounded document operations over a caller-supplied model executor.

## Inheritance

- object
- OfficeAiEngine

Filter members 

Show inherited

## Constructors

`public OfficeAiEngine(IOfficeAiExecutor executor)` [#](#constructor-ctor-officeimo-ai-iofficeaiexecutor)

[OfficeAiEngine.cs:15](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.AI/OfficeAiEngine.cs#L15)

Creates an engine. The caller owns the executor and its connection lifetime.

Parameters

**executor OfficeIMO.AI.IOfficeAiExecutor required**

## Methods

`public async Task<OfficeAiResult> RunAsync(OfficeAiDocument document, OfficeAiRequest request, IProgress<OfficeAiProgress>? progress = null, CancellationToken cancellationToken = default)` [#](#method-runasync-officeimo-ai-officeaidocument-officeimo-ai-officeairequest-iprogress-officeimo-ai-officeaiprogress-threading-cancellationtoken)

Processes an immutable snapshot. Remote processing requires explicit request authorization. Cancellation/timeout stops new work and ignores late results. Provider exceptions are sanitized in the result.

Parameters

**document OfficeIMO.AI.OfficeAiDocument required**

**request OfficeIMO.AI.OfficeAiRequest required**

**progress System.IProgress<OfficeIMO.AI.OfficeAiProgress>? = null optional**

**cancellationToken System.Threading.CancellationToken = default optional**

Returns

`Task<OfficeAiResult>`

Exceptions

- `InvalidDataException` – The executor cannot measure a request before inference starts; no model request is sent.

## Inherited Methods

`public virtual bool Equals(object? obj)` [#](#method-equals-object)

Inherited from object

Parameters

**obj object? required**

Returns

`bool`

`public virtual int GetHashCode()` [#](#method-gethashcode)

Inherited from object

Returns

`int`

`public Type GetType()` [#](#method-gettype)

Inherited from object

Returns

`Type`

`public virtual string? ToString()` [#](#method-tostring)

Inherited from object

Returns

`string?`

<!-- PowerForge markdown artifact sha256:656442B90F6A3A6AA52286F65D553F9FBE804489160023ECBB846521A7B74031 -->
