Class ChatGenerationPlan
- Namespace
- MailFathom.AI.Chat
- Assembly
- MailFathom.AI.dll
The validated declaration the chat adapter runs on: which endpoint answers, with which parameters, and what one call may spend.
public sealed class ChatGenerationPlan
- Inheritance
-
ChatGenerationPlan
- Inherited Members
Remarks
Built once, at startup, from configuration that has already been proved usable. The adapter therefore never revalidates and holds no defaulting logic of its own.
At most three models rather than a chain of any length, and every one of them named by the deployment: the model a capability was routed to, the fallback that reference names, and the model the deployment answers questions with. The difference from the embedding chain is what a fall-through can change: every embedding endpoint of a chain declares the same geometry, so a fallback cannot change what a vector means, while two chat models answer in different voices with different capabilities and different refusals. That is why the second model is named by the operator in the reference that selects the first, and why the run reports which one answered — the substitution is declared and visible rather than inferred here. A call the first model *refused* is not repeated against the second, because a second endpoint refuses a malformed request the same way and the attempt would be paid for twice.
Deliberately holds no credential and no secret reference. What proves the deployment's identity to the endpoint is resolved per request, so a rotated key needs no restart and this value is safe to hold for the lifetime of the process.
Fields
- GreatestAdditionalPropertyCount
The greatest number of additional request members one model may declare.
- GreatestChainLength
The greatest number of models one call may be attempted against.
Properties
- AdditionalProperties
Gets the request members every call carries beside the ones this deployment writes, keyed by their wire name.
- Chain
Gets this plan and the models behind it, in the order a call tries them.
- Endpoint
Gets the endpoint every request is sent to.
- Fallback
Gets the model a call this one could not have answered is attempted against, or null where the deployment named none.
- MaximumMessagesPerRequest
Gets the greatest number of turns one request carries.
- MaximumOutputTokens
Gets the greatest number of tokens one answer may occupy.
- MaximumRequestCharacters
Gets the greatest number of characters the turns of one request may add up to.
- MaximumRequestImageOctets
Gets the greatest number of octets the images of one request may add up to.
- ReasoningEffort
Gets the reasoning effort every call states, or null to send no reasoning parameter at all.
- RequestTimeout
Gets the time one request may take before it is abandoned.
- Temperature
Gets the sampling temperature, or null to leave the model's own default in place.
Methods
- Create(ChatEndpoint, int, float?, float?, string?, int, int, int, TimeSpan, IReadOnlyDictionary<string, JsonElement>?)
Builds a plan, refusing a declaration no request could be made from.
- IsOwnedRequestMember(string)
Reports whether a request member is one this deployment writes itself or declares a key for.
- IsUsableAdditionalPropertyName(string)
Reports whether a name is shaped like a top-level request member an additional property could write.
- IsUsableReasoningEffort(string)
Reports whether a reasoning effort is shaped like a level a provider could read.
- WithFallback(ChatGenerationPlan)
Builds the same plan with a further model behind it.