АРЧ АП11 - Включить response guard для capability binding ассистента
This commit is contained in:
@@ -7,6 +7,7 @@ import {
|
||||
type AddressLlmPreDecomposeMetaLogInput,
|
||||
type FinalizeAssistantAddressTurnInput
|
||||
} from "./assistantAddressTurnFinalizeRuntimeAdapter";
|
||||
import { applyAssistantCapabilityBindingResponseGuard } from "./assistantCapabilityBindingResponseGuard";
|
||||
import { attachAssistantCapabilityRuntimeBinding } from "./assistantCapabilityRuntimeBindingAdapter";
|
||||
import { attachAssistantRuntimeContractShadow } from "./assistantRuntimeContractResolver";
|
||||
import { attachAssistantStateTransition } from "./assistantStateTransitionRuntimeAdapter";
|
||||
@@ -266,14 +267,23 @@ export function runAssistantAddressLaneResponseRuntime<ResponseType = AssistantM
|
||||
addressRuntimeMeta: input.llmPreDecomposeMeta,
|
||||
replyType: normalizeAddressReplyType(input.addressLane.reply_type)
|
||||
});
|
||||
const guardedResponse = applyAssistantCapabilityBindingResponseGuard({
|
||||
assistantReply: safeAddressReply,
|
||||
replyType: normalizeAddressReplyType(input.addressLane.reply_type),
|
||||
capabilityBinding: debugWithCapabilityBinding.assistant_capability_binding_v1
|
||||
});
|
||||
const debugWithResponseGuard = {
|
||||
...debugWithCapabilityBinding,
|
||||
capability_binding_response_guard: guardedResponse.audit
|
||||
};
|
||||
const finalization = finalizeAddressTurnSafe({
|
||||
sessionId: input.sessionId,
|
||||
userMessage: input.userMessage,
|
||||
effectiveAddressUserMessage: input.effectiveAddressUserMessage,
|
||||
assistantReply: safeAddressReply,
|
||||
replyType: normalizeAddressReplyType(input.addressLane.reply_type),
|
||||
assistantReply: guardedResponse.assistantReply,
|
||||
replyType: guardedResponse.replyType,
|
||||
addressLaneDebug: normalizeAddressLaneDebug(input.addressLane.debug),
|
||||
debug: debugWithCapabilityBinding,
|
||||
debug: debugWithResponseGuard,
|
||||
carryoverMeta: normalizeCarryoverMeta(input.carryoverMeta),
|
||||
llmPreDecomposeMeta: normalizeLlmPreDecomposeMeta(input.llmPreDecomposeMeta),
|
||||
appendItem: input.appendItem,
|
||||
@@ -286,6 +296,6 @@ export function runAssistantAddressLaneResponseRuntime<ResponseType = AssistantM
|
||||
|
||||
return {
|
||||
response: finalization.response as ResponseType,
|
||||
debug: debugWithCapabilityBinding
|
||||
debug: debugWithResponseGuard
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user