Documentation
Table of Contents

Class MappingOptions

Namespace
IntentSharp.Mapping
Assembly
IntentSharp.dll

Options for one compiled-mapping call: the request options of the compile, the namespace, what the caller declares about the input, the golden samples, and how a stored mapping is reused, replaced and checked. A call never changes the options instance you pass to it.

public sealed class MappingOptions
Inheritance
object
MappingOptions
Inherited Members
object.Equals(object)
object.Equals(object, object)
object.GetHashCode()
object.GetType()
object.ReferenceEquals(object, object)
object.ToString()
Extension Methods

Remarks

The intent, the declarations (SourceSchema, SourceAllowedValues, SourceFormats), the golden samples, KeyMaterial, and the request's ExpectedOutputDescription, SystemInstructions and Examples are part of the mapping key, so changing any of them compiles the mapping again, as do the client's registered converters (WithMappingConverters(Action<MappingConverterRegistry>)). The request's validators are not part of the key: they run on every output, and a validator change that widens what is valid does not compile again (change KeyMaterial or call with Recompile). A reuse is measured against the samples the mapping was compiled on (see Profile); drift is noticed only when it moves those measurements, adds a warning, and never changes or fails a result. The warning is added to every call that measures it, or, with the setting mapping.driftWarnings set to oncePerRevision, once per client and mapping revision.

Constructors

MappingOptions()

Creates options with the default on each property.

Properties

CompileSampleRows

The most input rows a batch compiles from, chosen to differ. Default 5.

CrossCheck

True to check a compile with one direct model answer on the triggering input, compared with the mapping's output. It is the same model checking itself; one more model call within the request's model-call ceiling. Default false.

GoldenSamples

Inputs with the outputs a mapping must produce for them, in order. Every compile and replacement must reproduce each one exactly.

KeyMaterial

More content for the key, canonicalized, such as a catalog definition's content; a change compiles the mapping again. Default null.

MappingTtl

How long a stored mapping is reused before a replacement is compiled; null, the default, reuses it with no time limit.

MaxRecompilesPerHour

The most replacements compiled per key per hour, shared by every process on the store. Default 3.

Namespace

The store namespace for this call; null uses the namespace the client's mapping store was configured with.

OnReuseFailure

What a stored mapping does when one of its steps fails on an input. Default Recompile: a value that does not parse compiles one replacement, capped by MaxRecompilesPerHour; a value outside a declared set never does. With Fail, a value the Reply checkpoint does not allow compiles nothing either, even when the setting mapping.replyCheck is recompileOnce.

Recompile

True to compile a replacement for the stored mapping on this call, after a person reviewed the reason. Default false.

Request

The request options of the compile: validators that run on every output, examples, the expected output description, system instructions, provider, model, attempts, the model-call ceiling and the time budget of the compile, DoNotRecord and tags. UseJudge must stay false: a reused mapping cannot run the judge.

RequireDistinctSamples

True to refuse a compile whose samples cannot tell two same-typed source members apart, instead of recording the copy as unproven. Default false.

ShadowCheckEvery

The shadow check, the compiled-mapping form of a side-by-side trial: every this many reuses of a key by this client (a single-input call, or a batch, whose first row is checked), the input is also answered by the model directly, through the ordinary pipeline with these request options, and the answer is compared with the mapping's output. A difference adds a warning naming the differing output paths and a Warning log line; the mapping's value is the one returned and the mapping is not retired. The extra call is counted in the result's usage and attempts (which name the model that answered) and in the client's model calls, while the result's provider and model stay empty. Reuses are counted only by calls that set this above 0, so the count starts with the first such call. Default 0, never.

ShareAcrossModels

True to leave the provider and model out of the key, so one mapping serves every model. Default false: a different compiling model compiles its own mapping.

SourceAllowedValues

Closed lists of the values an input member may hold, by the member's JSON Pointer (an array item's member as /lines/*/code, which also applies to a read of one item, such as /lines/0/code; a key written with an index is not read). Only a member with a declared list, an enum or a boolean may be mapped through a table.

SourceFormats

What is declared about the format of input members, by the member's JSON Pointer (an array item's member as /lines/*/placed, which also applies to a read of one item, such as /lines/0/placed; a key written with an index is not read): date formats, number separators, the time zone, and fixed formats with their masks.

SourceSchema

A JSON schema for the input, which then describes the input shape instead of its .NET type and lets the input be read as JSON. Required for a JSON input, and for an input type the shape descriptor refuses (a JSON value, a dictionary, a polymorphic type).

Methods

AddSample<TIn, TOut>(TIn, TOut)

Adds a golden sample: an input and the output the mapping must produce for it.

Clone()

Returns a copy with copied collections and request options. A call never changes the options instance you pass to it.