АРЧ - Ассистент: отделить meta-followup по прошлому ответу от повторного запуска address lane
This commit is contained in:
@@ -31,11 +31,13 @@ export interface RunAssistantAddressLaneRuntimeInput {
|
||||
userMessage: string;
|
||||
addressInputMessage: string;
|
||||
carryover: AssistantAddressFollowupCarryoverLike | null;
|
||||
llmSemanticHints?: Record<string, unknown> | null;
|
||||
shouldPreferContextualLane: boolean;
|
||||
canRetryWithRawUserMessage: boolean;
|
||||
runAddressLaneAttempt: (
|
||||
messageUsed: string,
|
||||
carryMeta: AssistantAddressFollowupCarryoverLike | null
|
||||
carryMeta: AssistantAddressFollowupCarryoverLike | null,
|
||||
llmSemanticHints?: Record<string, unknown> | null
|
||||
) => Promise<AssistantAddressLaneLike | null>;
|
||||
isRetryableAddressLimitedResult: (addressLane: AssistantAddressLaneLike | null | undefined) => boolean;
|
||||
}
|
||||
@@ -95,7 +97,11 @@ export async function runAssistantAddressLaneRuntime(
|
||||
};
|
||||
|
||||
if (input.shouldPreferContextualLane) {
|
||||
const contextualAddressLane = await input.runAddressLaneAttempt(input.addressInputMessage, input.carryover);
|
||||
const contextualAddressLane = await input.runAddressLaneAttempt(
|
||||
input.addressInputMessage,
|
||||
input.carryover,
|
||||
input.llmSemanticHints ?? null
|
||||
);
|
||||
const decision = evaluateAddressLane(contextualAddressLane, input.addressInputMessage, input.carryover);
|
||||
if (decision.action === "return") {
|
||||
return {
|
||||
@@ -106,7 +112,11 @@ export async function runAssistantAddressLaneRuntime(
|
||||
}
|
||||
}
|
||||
|
||||
const primaryAddressLane = await input.runAddressLaneAttempt(input.addressInputMessage, null);
|
||||
const primaryAddressLane = await input.runAddressLaneAttempt(
|
||||
input.addressInputMessage,
|
||||
null,
|
||||
input.llmSemanticHints ?? null
|
||||
);
|
||||
const primaryDecision = evaluateAddressLane(primaryAddressLane, input.addressInputMessage, null);
|
||||
if (primaryDecision.action === "return") {
|
||||
return {
|
||||
@@ -117,7 +127,11 @@ export async function runAssistantAddressLaneRuntime(
|
||||
}
|
||||
|
||||
if (!input.shouldPreferContextualLane && input.carryover?.followupContext) {
|
||||
const contextualAddressLane = await input.runAddressLaneAttempt(input.addressInputMessage, input.carryover);
|
||||
const contextualAddressLane = await input.runAddressLaneAttempt(
|
||||
input.addressInputMessage,
|
||||
input.carryover,
|
||||
input.llmSemanticHints ?? null
|
||||
);
|
||||
const contextualDecision = evaluateAddressLane(contextualAddressLane, input.addressInputMessage, input.carryover);
|
||||
if (contextualDecision.action === "return") {
|
||||
return {
|
||||
@@ -139,7 +153,11 @@ export async function runAssistantAddressLaneRuntime(
|
||||
|
||||
if (input.carryover?.followupContext) {
|
||||
retryAudit.retry_used_followup_context = true;
|
||||
const rawContextualLane = await input.runAddressLaneAttempt(input.userMessage, input.carryover);
|
||||
const rawContextualLane = await input.runAddressLaneAttempt(
|
||||
input.userMessage,
|
||||
input.carryover,
|
||||
input.llmSemanticHints ?? null
|
||||
);
|
||||
const rawContextualDecision = evaluateAddressLane(rawContextualLane, input.userMessage, input.carryover);
|
||||
if (rawContextualDecision.action === "return") {
|
||||
retryAudit.retry_result_category = limitedCategory(rawContextualDecision.selection.addressLane);
|
||||
@@ -151,7 +169,7 @@ export async function runAssistantAddressLaneRuntime(
|
||||
}
|
||||
}
|
||||
|
||||
const rawPrimaryLane = await input.runAddressLaneAttempt(input.userMessage, null);
|
||||
const rawPrimaryLane = await input.runAddressLaneAttempt(input.userMessage, null, input.llmSemanticHints ?? null);
|
||||
retryAudit.retry_result_category = limitedCategory(rawPrimaryLane);
|
||||
const rawPrimaryDecision = evaluateAddressLane(rawPrimaryLane, input.userMessage, null);
|
||||
if (rawPrimaryDecision.action === "return") {
|
||||
|
||||
Reference in New Issue
Block a user