|
1 | 1 | import { |
| 2 | + deriveAmbiguity, |
2 | 3 | type CommitPolicyOutput, |
3 | 4 | type ConversationEntity, |
4 | 5 | type TurnAmbiguity, |
@@ -33,7 +34,12 @@ type StructuredWriteReadiness = |
33 | 34 | export function decideTurnPolicy(input: DecideTurnPolicyInput): TurnPolicyDecision { |
34 | 35 | const { classification, commitResult } = input; |
35 | 36 | const targetEntityId = classification.resolvedEntityIds[0]; |
36 | | - const ambiguity = deriveAmbiguity(classification, commitResult); |
| 37 | + const ambiguity = deriveAmbiguity({ |
| 38 | + classifierConfidence: classification.confidence, |
| 39 | + missingSlots: commitResult.missingSlots, |
| 40 | + needsClarification: commitResult.needsClarification, |
| 41 | + blockingSlots: [] |
| 42 | + }); |
37 | 43 |
|
38 | 44 | switch (classification.turnType) { |
39 | 45 | case "informational": |
@@ -109,17 +115,6 @@ export function decideTurnPolicy(input: DecideTurnPolicyInput): TurnPolicyDecisi |
109 | 115 | } |
110 | 116 | } |
111 | 117 |
|
112 | | -function deriveAmbiguity( |
113 | | - classification: TurnClassifierOutput, |
114 | | - commitResult: CommitPolicyOutput |
115 | | -): TurnAmbiguity { |
116 | | - if (classification.confidence < 0.6) return "high"; |
117 | | - if (commitResult.missingSlots.length > 0) return "high"; |
118 | | - if (commitResult.needsClarification.length > 0) return "high"; |
119 | | - if (classification.confidence < 0.8) return "low"; |
120 | | - return "none"; |
121 | | -} |
122 | | - |
123 | 118 | function deriveStructuredWriteReadiness( |
124 | 119 | input: DecideTurnPolicyInput, |
125 | 120 | ambiguity: TurnAmbiguity |
|
0 commit comments