Documentation
Table of Contents

Method ReadOffer

Namespace
IntentSharp.Specialist
Assembly
IntentSharp.Specialist.dll

ReadOffer(string, string, IAIProvider?)

Reads an offer from intent-file text that holds one definition: the definition becomes Definition, without the ExtensionName extension, which is read into Info, Model and, unless provider is given, ProviderName.

public static SpecialistOffer ReadOffer(string text, string path, IAIProvider? provider = null)

Parameters

text string

The intent-file text the service returned.

path string

A name for the text whose extension (.json, .yaml or .yml) chooses the format.

provider IAIProvider

The specialist as a provider the adapter built, which becomes Provider; null to take the name of a configured provider from extensions.specialist.provider.

Returns

SpecialistOffer

The offer.

Exceptions

ArgumentNullException

text or path is null.

ArgumentException

path does not end in .json, .yaml or .yml.

SpecialistOfferException

The text does not hold exactly one valid definition, the extension is not an object or holds a value of the wrong type, or no provider is given and the extension names none.