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
textstringThe intent-file text the service returned.
pathstringA name for the text whose extension (
.json,.yamlor.yml) chooses the format.providerIAIProviderThe 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
textorpathis null.- ArgumentException
pathdoes not end in.json,.yamlor.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.