Optional utilityId: stringOptional options: SummarizationOptionsThe JSON the text holds, read as StatisticalUtilityAI reads it (parseReplyJson: the text as it is, else inside
the first Markdown code fence it holds, backticks inside a sentence opening none, with a language tag or none and
with words before or after it, up to the first later line that starts with as many backticks as opened the fence or
more), then a check against targetSchema with Ajv when given, as StatisticalUtilityAI checks it: the standard
formats checked, a keyword or a format Ajv does not know passed over, and a value coerced to the type its schema
names where it can (targetSchemaChecks). With attemptFixWithLLM, a text that fails either is sent for repair,
up to maxRepairAttempts times (1 unless it is a whole number of 1 or more), each repair on the text the last one
answered, whose answer is read the same way, on llmModelIdForFix (else jsonFixerModelId, else defaultModelId)
and llmProviderIdForFix (else defaultProviderId). A repair request names targetSchema when given, and the
schema's errors when the text parsed and failed it. Answers null when no repair parses and passes the schema, or
a repair call fails. No text can pass a targetSchema that Ajv cannot compile, that takes the draft-07
meta-schema's $id or that is marked $async: the call answers null at once, with a warning, and asks for no
repair.
Optional options: ParseJsonOptions<T>Optional options: KeywordExtractionOptionsOptional options: SentimentAnalysisOptionsOptional options: LanguageDetectionOptionsOptional options: TokenizationOptionsOptional _options: StemmingOptionsOptional options: SimilarityOptionsOptional options: TextNormalizationOptionsSummarizes conversation history to fit within token constraints, attempting to preserve key information.
The array of conversation messages to summarize.
The desired maximum token count for the summary.
Information about the model for which the summary is being prepared.
Optional preserveImportantMessages: booleanIf true, attempt to identify and keep important messages verbatim.
A summary (which might be a single system message or a condensed list of messages), and metadata about the summarization.
Summarizes retrieved RAG context to fit token limits, ideally preserving source attribution if possible.
The RAG context to summarize.
The desired maximum token count for the summarized context.
Information about the model.
Optional preserveSourceAttribution: booleanIf true, attempt to retain source information in the summary.
The summarized text and metadata.
Readonly utility
Interface
IUtilityAI Defines the contract for a comprehensive Utility AI service.