ARCH: добавить runtime authority смысла текущей реплики
This commit is contained in:
@@ -1904,6 +1904,11 @@ export function resolveAddressIntent(userMessage: string): AddressIntentResoluti
|
||||
const text = String(userMessage ?? "").trim().toLowerCase();
|
||||
const repairedText = repairLikelyUtf8Mojibake(text).trim().toLowerCase();
|
||||
const bridgeText = repairedText && repairedText !== text ? `${text} ${repairedText}` : text;
|
||||
const turnNoiseNormalizedBridgeText = bridgeText
|
||||
.replace(/(^|[^\p{L}0-9_])\u043d\u0430\u043c\u0441(?=$|[^\p{L}0-9_])/giu, "$1\u043d\u0430\u043c")
|
||||
.replace(/(^|[^\p{L}0-9_])\u043a\u0430\u043a\u0438\u0435\u043a(?=$|[^\p{L}0-9_])/giu, "$1\u043a\u0430\u043a\u0438\u0435");
|
||||
const currentTurnBridgeText =
|
||||
turnNoiseNormalizedBridgeText !== bridgeText ? `${bridgeText} ${turnNoiseNormalizedBridgeText}` : bridgeText;
|
||||
|
||||
const hasLooseVatPayableBridge =
|
||||
/(?:\u043d\u0434\u0441|vat)/iu.test(text) &&
|
||||
@@ -1923,25 +1928,31 @@ export function resolveAddressIntent(userMessage: string): AddressIntentResoluti
|
||||
|
||||
const hasExplicitReceivablesSnapshotBridge =
|
||||
/(?:\u043d\u0430\u043c\s+\u043a\u0442\u043e-\u0442\u043e\s+\u0434\u043e\u043b\u0436\u0435\u043d|\u043d\u0430\u043c\s+\u043a\u0442\u043e\s+\u0434\u043e\u043b\u0436\u0435\u043d|\u043a\u0442\u043e\s+\u043d\u0430\u043c\s+\u0434\u043e\u043b\u0436\u0435\u043d|\u0435\u0441\u0442\u044c\s+\u043b\u0438\s+\u0434\u0435\u0431\u0438\u0442\u043e\u0440\u0441\u043a\w+\s+\u0437\u0430\u0434\u043e\u043b\u0436\u0435\u043d\u043d\u043e\u0441\u0442\u044c|\u0437\u0430\u0434\u043e\u043b\u0436\u0435\u043d\u043d\u043e\u0441\u0442\u044c\s+\u043d\u0430\u043c|receivables?)/iu.test(
|
||||
text
|
||||
currentTurnBridgeText
|
||||
);
|
||||
if (hasExplicitReceivablesSnapshotBridge) {
|
||||
return {
|
||||
intent: "receivables_confirmed_as_of_date",
|
||||
confidence: "high",
|
||||
reasons: ["receivables_snapshot_bridge_signal_detected"]
|
||||
reasons:
|
||||
currentTurnBridgeText !== bridgeText
|
||||
? ["receivables_snapshot_bridge_signal_detected", "current_turn_noise_normalized"]
|
||||
: ["receivables_snapshot_bridge_signal_detected"]
|
||||
};
|
||||
}
|
||||
|
||||
const hasExplicitPayablesSnapshotBridge =
|
||||
/(?:\u043c\u044b\s+\u0434\u043e\u043b\u0436\u043d\u044b\s+\u043a\u043e\u043c\u0443-\u0442\u043e\s+\u0434\u0435\u043d\u0435\u0433|\u043c\u044b\s+\u0434\u043e\u043b\u0436\u043d\u044b\s+\u043a\u043e\u043c\u0443\u0442\u043e\s+\u0434\u0435\u043d\u0435\u0433|\u043c\u044b\s+\u043a\u043e\u043c\u0443-\u0442\u043e\s+\u0434\u043e\u043b\u0436\u043d\u044b|\u043a\u043e\u043c\u0443\s+\u043c\u044b\s+\u0434\u043e\u043b\u0436\u043d\u044b|\u0435\u0441\u0442\u044c\s+\u043b\u0438\s+\u0437\u0430\u0434\u043e\u043b\u0436\u0435\u043d\u043d\u043e\u0441\u0442\u044c\s+\u043f\u0435\u0440\u0435\u0434\s+\u043a\u043e\u043d\u0442\u0440\u0430\u0433\u0435\u043d\u0442\u0430\u043c\u0438|\u0437\u0430\u0434\u043e\u043b\u0436\u0435\u043d\u043d\u043e\u0441\u0442\u044c\s+\u043f\u0435\u0440\u0435\u0434\s+\u043a\u043e\u043d\u0442\u0440\u0430\u0433\u0435\u043d\u0442\u0430\u043c\u0438|payables?)/iu.test(
|
||||
text
|
||||
currentTurnBridgeText
|
||||
);
|
||||
if (hasExplicitPayablesSnapshotBridge) {
|
||||
return {
|
||||
intent: "payables_confirmed_as_of_date",
|
||||
confidence: "high",
|
||||
reasons: ["payables_snapshot_bridge_signal_detected"]
|
||||
reasons:
|
||||
currentTurnBridgeText !== bridgeText
|
||||
? ["payables_snapshot_bridge_signal_detected", "current_turn_noise_normalized"]
|
||||
: ["payables_snapshot_bridge_signal_detected"]
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -222,7 +222,8 @@ export function createAssistantRoutePolicy(deps) {
|
||||
compactWhitespace,
|
||||
hasDeepSessionContinuationSignal,
|
||||
resolveLivingAssistantModeDecision,
|
||||
resolveProviderExecutionState
|
||||
resolveProviderExecutionState,
|
||||
resolveAssistantTurnMeaning
|
||||
} = deps;
|
||||
function resolveBaseAddressToolGateDecision(addressInputMessage, followupContext, llmPreDecomposeMeta = null, rawUserMessage = null) {
|
||||
const repairedInputMessage = repairAddressMojibake(String(addressInputMessage ?? ""));
|
||||
@@ -455,8 +456,32 @@ export function createAssistantRoutePolicy(deps) {
|
||||
const resolvedModeDetection = modeDetection.mode === "address_query" ? modeDetection : modeDetectionRaw;
|
||||
const intentResolution = resolveAddressIntent(modeSample);
|
||||
const intentResolutionRaw = resolveAddressIntent(repairedRawUserMessage || rawUserMessage);
|
||||
const resolvedIntentResolution = intentResolution.intent !== "unknown" ? intentResolution : intentResolutionRaw;
|
||||
const llmContractIntent = toNonEmptyString(llmPreDecomposeMeta?.predecomposeContract?.intent);
|
||||
const assistantTurnMeaning =
|
||||
typeof resolveAssistantTurnMeaning === "function"
|
||||
? resolveAssistantTurnMeaning({
|
||||
rawUserMessage,
|
||||
effectiveAddressUserMessage,
|
||||
repairedRawUserMessage,
|
||||
repairedEffectiveAddressUserMessage,
|
||||
llmPreDecomposeMeta
|
||||
})
|
||||
: null;
|
||||
const turnMeaningIntentCandidate = toNonEmptyString(assistantTurnMeaning?.explicit_intent_candidate);
|
||||
const baseResolvedIntentResolution = intentResolution.intent !== "unknown" ? intentResolution : intentResolutionRaw;
|
||||
const resolvedIntentResolution =
|
||||
turnMeaningIntentCandidate &&
|
||||
baseResolvedIntentResolution.intent === "unknown" &&
|
||||
ADDRESS_INTENTS_KEEP_ADDRESS_LANE.has(turnMeaningIntentCandidate)
|
||||
? {
|
||||
intent: turnMeaningIntentCandidate,
|
||||
confidence: assistantTurnMeaning?.meaning_confidence === "high" ? "high" : "medium",
|
||||
reasons: [
|
||||
"assistant_turn_meaning_intent_recovery",
|
||||
...(Array.isArray(assistantTurnMeaning?.reason_codes) ? assistantTurnMeaning.reason_codes : [])
|
||||
]
|
||||
}
|
||||
: baseResolvedIntentResolution;
|
||||
const llmPreDecomposeReason = toNonEmptyString(llmPreDecomposeMeta?.reason);
|
||||
const providerExecution = resolveProviderExecutionState({
|
||||
useMock,
|
||||
@@ -1178,6 +1203,7 @@ export function createAssistantRoutePolicy(deps) {
|
||||
schema_version: "assistant_orchestration_contract_v1",
|
||||
hard_meta_mode: null,
|
||||
provider_execution: providerExecution,
|
||||
assistant_turn_meaning: assistantTurnMeaning,
|
||||
address_mode: resolvedModeDetection.mode,
|
||||
address_mode_confidence: resolvedModeDetection.confidence,
|
||||
address_intent: resolvedIntentResolution.intent,
|
||||
|
||||
@@ -28,6 +28,7 @@ import * as assistantMetaFollowupPolicy_1 from "./assistantMetaFollowupPolicy";
|
||||
import * as assistantMemoryRecapPolicy_1 from "./assistantMemoryRecapPolicy";
|
||||
import * as assistantContinuityPolicy_1 from "./assistantContinuityPolicy";
|
||||
import * as assistantProviderExecutionPolicy_1 from "./assistantProviderExecutionPolicy";
|
||||
import * as assistantTurnMeaningPolicy_1 from "./assistantTurnMeaningPolicy";
|
||||
import * as assistantRoutePolicy_1 from "./assistantRoutePolicy";
|
||||
import * as assistantTransitionPolicy_1 from "./assistantTransitionPolicy";
|
||||
import * as assistantOrganizationScopeRuntimeAdapter_1 from "./assistantOrganizationScopeRuntimeAdapter";
|
||||
@@ -4014,6 +4015,12 @@ const assistantMemoryRecapPolicy = (0, assistantMemoryRecapPolicy_1.createAssist
|
||||
hasConversationMemoryRecallFollowupSignal: assistantLivingModePolicy.hasConversationMemoryRecallFollowupSignal,
|
||||
isGroundedInventoryContextDebug
|
||||
});
|
||||
const assistantTurnMeaningPolicy = (0, assistantTurnMeaningPolicy_1.createAssistantTurnMeaningPolicy)({
|
||||
compactWhitespace,
|
||||
repairAddressMojibake,
|
||||
resolveAddressIntent: addressIntentResolver_1.resolveAddressIntent,
|
||||
toNonEmptyString
|
||||
});
|
||||
const assistantRoutePolicy = (0, assistantRoutePolicy_1.createAssistantRoutePolicy)({
|
||||
repairAddressMojibake,
|
||||
findLastGroundedAddressAnswerDebug,
|
||||
@@ -4053,7 +4060,8 @@ const assistantRoutePolicy = (0, assistantRoutePolicy_1.createAssistantRoutePoli
|
||||
compactWhitespace,
|
||||
hasDeepSessionContinuationSignal,
|
||||
resolveLivingAssistantModeDecision: assistantLivingModePolicy.resolveLivingAssistantModeDecision,
|
||||
resolveProviderExecutionState: assistantProviderExecutionPolicy.resolveProviderExecutionState
|
||||
resolveProviderExecutionState: assistantProviderExecutionPolicy.resolveProviderExecutionState,
|
||||
resolveAssistantTurnMeaning: assistantTurnMeaningPolicy.resolveAssistantTurnMeaning
|
||||
});
|
||||
const assistantTransitionPolicy = (0, assistantTransitionPolicy_1.createAssistantTransitionPolicy)({
|
||||
compactWhitespace,
|
||||
@@ -4089,7 +4097,8 @@ const assistantTransitionPolicy = (0, assistantTransitionPolicy_1.createAssistan
|
||||
buildRootScopedCarryoverFilters,
|
||||
inferDisplayedEntityTypeFromIntent,
|
||||
extractDisplayedAddressEntityCandidates,
|
||||
resolveDisplayedAddressEntityMention
|
||||
resolveDisplayedAddressEntityMention,
|
||||
resolveAssistantTurnMeaning: assistantTurnMeaningPolicy.resolveAssistantTurnMeaning
|
||||
});
|
||||
const assistantDataScopePolicy = (0, assistantDataScopePolicy_1.createAssistantDataScopePolicy)({
|
||||
activeMcpChannel: config_1.ASSISTANT_MCP_CHANNEL,
|
||||
|
||||
@@ -381,6 +381,17 @@ export function createAssistantTransitionPolicy(deps) {
|
||||
if (rawCapabilityMetaQuery && !rawDataRetrievalSignal) {
|
||||
return null;
|
||||
}
|
||||
const assistantTurnMeaning =
|
||||
typeof deps.resolveAssistantTurnMeaning === "function"
|
||||
? deps.resolveAssistantTurnMeaning({
|
||||
rawUserMessage: userMessage,
|
||||
effectiveAddressUserMessage: alternateMessage ?? userMessage,
|
||||
llmPreDecomposeMeta
|
||||
})
|
||||
: null;
|
||||
if (assistantTurnMeaning?.stale_replay_forbidden === true) {
|
||||
return null;
|
||||
}
|
||||
const latestAddressItem = deps.findLastAddressAssistantItem(items);
|
||||
const previousAddressItem =
|
||||
(latestAddressItem && isUsableFollowupSourceDebug(latestAddressItem?.debug)
|
||||
@@ -566,6 +577,7 @@ export function createAssistantTransitionPolicy(deps) {
|
||||
const resolvedAlternateIntent = deps.toNonEmptyString(alternateMessage)
|
||||
? deps.resolveAddressIntent(deps.repairAddressMojibake(String(alternateMessage ?? ""))).intent
|
||||
: null;
|
||||
const assistantTurnMeaningIntent = deps.toNonEmptyString(assistantTurnMeaning?.explicit_intent_candidate);
|
||||
const explicitIntent =
|
||||
llmExplicitIntent && llmExplicitIntent !== "unknown"
|
||||
? llmExplicitIntent
|
||||
@@ -573,7 +585,9 @@ export function createAssistantTransitionPolicy(deps) {
|
||||
? resolvedPrimaryIntent
|
||||
: resolvedAlternateIntent && resolvedAlternateIntent !== "unknown"
|
||||
? resolvedAlternateIntent
|
||||
: null;
|
||||
: assistantTurnMeaningIntent && assistantTurnMeaningIntent !== "unknown"
|
||||
? assistantTurnMeaningIntent
|
||||
: null;
|
||||
const sourceIntentFamily = deps.resolveAddressIntentFamily(sourceIntent);
|
||||
const explicitIntentFamily =
|
||||
deps.resolveAddressIntentFamily(explicitIntent) ??
|
||||
|
||||
@@ -0,0 +1,192 @@
|
||||
// @ts-nocheck
|
||||
|
||||
const SUPPORTED_ADDRESS_INTENTS = new Set([
|
||||
"receivables_confirmed_as_of_date",
|
||||
"payables_confirmed_as_of_date",
|
||||
"list_documents_by_counterparty",
|
||||
"inventory_on_hand_as_of_date"
|
||||
]);
|
||||
|
||||
function fallbackCompactWhitespace(value) {
|
||||
return String(value ?? "").replace(/\s+/g, " ").trim();
|
||||
}
|
||||
|
||||
function normalizeTurnText(value, deps) {
|
||||
const compactWhitespace = typeof deps?.compactWhitespace === "function" ? deps.compactWhitespace : fallbackCompactWhitespace;
|
||||
const repaired =
|
||||
typeof deps?.repairAddressMojibake === "function"
|
||||
? deps.repairAddressMojibake(String(value ?? ""))
|
||||
: String(value ?? "");
|
||||
return compactWhitespace(repaired.toLowerCase())
|
||||
.replace(/\u0451/gu, "\u0435")
|
||||
.replace(/(^|[^\p{L}0-9_])\u043d\u0430\u043c\u0441(?=$|[^\p{L}0-9_])/giu, "$1\u043d\u0430\u043c")
|
||||
.replace(/(^|[^\p{L}0-9_])\u043a\u0430\u043a\u0438\u0435\u043a(?=$|[^\p{L}0-9_])/giu, "$1\u043a\u0430\u043a\u0438\u0435");
|
||||
}
|
||||
|
||||
function toNonEmptyString(value, deps) {
|
||||
if (typeof deps?.toNonEmptyString === "function") {
|
||||
return deps.toNonEmptyString(value);
|
||||
}
|
||||
if (value === null || value === undefined) {
|
||||
return null;
|
||||
}
|
||||
const text = String(value).trim();
|
||||
return text.length > 0 ? text : null;
|
||||
}
|
||||
|
||||
function detectSupportedIntent(text, deps) {
|
||||
const resolved = typeof deps?.resolveAddressIntent === "function" ? deps.resolveAddressIntent(text) : null;
|
||||
const resolverIntent = toNonEmptyString(resolved?.intent, deps);
|
||||
if (resolverIntent && resolverIntent !== "unknown" && SUPPORTED_ADDRESS_INTENTS.has(resolverIntent)) {
|
||||
return {
|
||||
intent: resolverIntent,
|
||||
confidence: toNonEmptyString(resolved?.confidence, deps) ?? "medium",
|
||||
reason: "address_intent_resolver_current_turn_signal"
|
||||
};
|
||||
}
|
||||
if (/(?:\u043a\u0442\u043e\s+\u043d\u0430\u043c\s+\u0434\u043e\u043b\u0436|\u043d\u0430\u043c\s+\u043a\u0442\u043e\s+\u0434\u043e\u043b\u0436|\u0434\u0435\u0431\u0438\u0442\u043e\u0440|\u0434\u0435\u0431\u0438\u0442\u043e\u0440\u0441\u043a|\breceivables?\b)/iu.test(text)) {
|
||||
return {
|
||||
intent: "receivables_confirmed_as_of_date",
|
||||
confidence: "high",
|
||||
reason: "receivables_current_turn_meaning_signal"
|
||||
};
|
||||
}
|
||||
if (/(?:\u043a\u043e\u043c\u0443\s+\u043c\u044b\s+\u0434\u043e\u043b\u0436|\u043c\u044b\s+\u043a\u043e\u043c\u0443\s+\u0434\u043e\u043b\u0436|\u043c\u044b\s+\u0434\u043e\u043b\u0436\u043d|\u043a\u0440\u0435\u0434\u0438\u0442\u043e\u0440|\bpayables?\b)/iu.test(text)) {
|
||||
return {
|
||||
intent: "payables_confirmed_as_of_date",
|
||||
confidence: "high",
|
||||
reason: "payables_current_turn_meaning_signal"
|
||||
};
|
||||
}
|
||||
if (/(?:\u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442|\u0434\u043e\u043a\u0438|docs?|documents?)/iu.test(text) && /(?:\u043f\u043e|by)\s+[\p{L}0-9._-]{2,}/iu.test(text)) {
|
||||
return {
|
||||
intent: "list_documents_by_counterparty",
|
||||
confidence: "medium",
|
||||
reason: "counterparty_documents_current_turn_signal"
|
||||
};
|
||||
}
|
||||
if (/(?:\u043e\u0441\u0442\u0430\u0442|\u0441\u043a\u043b\u0430\u0434|inventory|stock)/iu.test(text)) {
|
||||
return {
|
||||
intent: "inventory_on_hand_as_of_date",
|
||||
confidence: "medium",
|
||||
reason: "inventory_snapshot_current_turn_signal"
|
||||
};
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
function detectCounterpartyTurnoverFamily(text) {
|
||||
const hasTurnoverCue = /(?:\u043e\u0431\u043e\u0440\u043e\u0442|\u0432\u044b\u0440\u0443\u0447\u043a|\u0434\u043e\u0445\u043e\u0434|turnover|revenue)/iu.test(text);
|
||||
if (!hasTurnoverCue) {
|
||||
return null;
|
||||
}
|
||||
const explicitEntityMatch = text.match(/(?:\u043f\u043e|by|for)?\s*([\p{L}0-9._-]{2,})\s*$/iu);
|
||||
const rawEntity = explicitEntityMatch?.[1] ?? null;
|
||||
const ignored = new Set([
|
||||
"\u043e\u0431\u043e\u0440\u043e\u0442",
|
||||
"\u0432\u044b\u0440\u0443\u0447\u043a\u0430",
|
||||
"\u0434\u043e\u0445\u043e\u0434",
|
||||
"\u0431\u044b\u043b",
|
||||
"\u0431\u044b\u043b\u0430",
|
||||
"turnover",
|
||||
"revenue"
|
||||
]);
|
||||
const entity = rawEntity && !ignored.has(rawEntity) ? rawEntity : null;
|
||||
return {
|
||||
family: "counterparty_value_or_turnover",
|
||||
entity
|
||||
};
|
||||
}
|
||||
|
||||
function buildEntityCandidates(counterpartyTurnover) {
|
||||
if (!counterpartyTurnover?.entity) {
|
||||
return [];
|
||||
}
|
||||
return [
|
||||
{
|
||||
type: "counterparty",
|
||||
value: counterpartyTurnover.entity,
|
||||
source: "current_turn_loose_entity_tail"
|
||||
}
|
||||
];
|
||||
}
|
||||
|
||||
export function createAssistantTurnMeaningPolicy(deps = {}) {
|
||||
function resolveAssistantTurnMeaning(input = {}) {
|
||||
const rawMessage = String(input?.rawUserMessage ?? input?.userMessage ?? "");
|
||||
const effectiveMessage = String(input?.effectiveAddressUserMessage ?? rawMessage);
|
||||
const rawText = normalizeTurnText(rawMessage, deps);
|
||||
const effectiveText = normalizeTurnText(effectiveMessage, deps);
|
||||
const joinedText = fallbackCompactWhitespace(`${rawText} ${effectiveText}`);
|
||||
const supportedIntent = detectSupportedIntent(joinedText, deps);
|
||||
const counterpartyTurnover = detectCounterpartyTurnoverFamily(joinedText);
|
||||
const llmIntent = toNonEmptyString(input?.llmPreDecomposeMeta?.predecomposeContract?.intent, deps);
|
||||
const explicitIntentCandidate =
|
||||
supportedIntent?.intent ?? (llmIntent && llmIntent !== "unknown" ? llmIntent : null);
|
||||
const unsupportedFamily = !explicitIntentCandidate && counterpartyTurnover?.family ? counterpartyTurnover.family : null;
|
||||
const reasonCodes = [];
|
||||
if (supportedIntent?.reason) {
|
||||
reasonCodes.push(supportedIntent.reason);
|
||||
}
|
||||
if (counterpartyTurnover?.family) {
|
||||
reasonCodes.push("counterparty_turnover_current_turn_signal");
|
||||
}
|
||||
if (rawText !== normalizeTurnText(rawMessage, { ...deps, repairAddressMojibake: (value) => String(value ?? "") })) {
|
||||
reasonCodes.push("mojibake_repair_applied");
|
||||
}
|
||||
if (
|
||||
rawText.includes("\u043d\u0430\u043c") &&
|
||||
/(^|[^\p{L}0-9_])\u043d\u0430\u043c\u0441(?=$|[^\p{L}0-9_])/iu.test(String(rawMessage ?? ""))
|
||||
) {
|
||||
reasonCodes.push("known_turn_typo_normalized");
|
||||
}
|
||||
const askedDomainFamily =
|
||||
explicitIntentCandidate?.startsWith("receivables_")
|
||||
? "receivables"
|
||||
: explicitIntentCandidate?.startsWith("payables_")
|
||||
? "payables"
|
||||
: explicitIntentCandidate?.startsWith("inventory_")
|
||||
? "inventory"
|
||||
: explicitIntentCandidate?.includes("counterparty")
|
||||
? "counterparty"
|
||||
: counterpartyTurnover?.family
|
||||
? "counterparty"
|
||||
: null;
|
||||
const askedActionFamily =
|
||||
explicitIntentCandidate === "receivables_confirmed_as_of_date" ||
|
||||
explicitIntentCandidate === "payables_confirmed_as_of_date" ||
|
||||
explicitIntentCandidate === "inventory_on_hand_as_of_date"
|
||||
? "confirmed_snapshot"
|
||||
: explicitIntentCandidate === "list_documents_by_counterparty"
|
||||
? "list_documents"
|
||||
: counterpartyTurnover?.family
|
||||
? "counterparty_value_or_turnover"
|
||||
: null;
|
||||
const staleReplayForbidden = Boolean(unsupportedFamily || (counterpartyTurnover?.entity && !explicitIntentCandidate));
|
||||
return {
|
||||
schema_version: "assistant_turn_meaning_v1",
|
||||
raw_message: rawMessage,
|
||||
effective_message: effectiveMessage,
|
||||
normalized_raw_message: rawText,
|
||||
normalized_effective_message: effectiveText,
|
||||
asked_domain_family: askedDomainFamily,
|
||||
asked_action_family: askedActionFamily,
|
||||
explicit_intent_candidate: explicitIntentCandidate,
|
||||
explicit_entity_candidates: buildEntityCandidates(counterpartyTurnover),
|
||||
meaning_confidence: supportedIntent?.confidence ?? (counterpartyTurnover?.family ? "medium" : "low"),
|
||||
intent_override_strength: explicitIntentCandidate
|
||||
? "explicit_current_turn_intent"
|
||||
: staleReplayForbidden
|
||||
? "explicit_new_action_or_entity"
|
||||
: "none",
|
||||
carryover_budget: staleReplayForbidden ? "none" : explicitIntentCandidate ? "matching_family_only" : "normal",
|
||||
unsupported_but_understood_family: unsupportedFamily,
|
||||
stale_replay_forbidden: staleReplayForbidden,
|
||||
reason_codes: reasonCodes
|
||||
};
|
||||
}
|
||||
|
||||
return {
|
||||
resolveAssistantTurnMeaning
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user