mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-06 11:40:42 +00:00
fix(google-meet): tighten realtime echo overlap
This commit is contained in:
@@ -3857,6 +3857,13 @@ describe("google-meet plugin", () => {
|
||||
nowMs,
|
||||
}),
|
||||
).toBe(false);
|
||||
expect(
|
||||
isGoogleMeetLikelyAssistantEchoTranscript({
|
||||
transcript,
|
||||
text: "yes yes yes yes",
|
||||
nowMs,
|
||||
}),
|
||||
).toBe(false);
|
||||
});
|
||||
|
||||
it("uses a local barge-in input command to clear active Chrome playback", async () => {
|
||||
|
||||
@@ -173,9 +173,13 @@ function hasMeaningfulEchoOverlap(userTokens: string[], assistantTokens: string[
|
||||
if (userTokens.length < 4 || assistantTokens.length < 4) {
|
||||
return false;
|
||||
}
|
||||
const uniqueUserTokens = [...new Set(userTokens)];
|
||||
if (uniqueUserTokens.length < 4) {
|
||||
return false;
|
||||
}
|
||||
const assistantTokenSet = new Set(assistantTokens);
|
||||
const overlap = userTokens.filter((token) => assistantTokenSet.has(token)).length;
|
||||
return overlap / userTokens.length >= 0.58;
|
||||
const overlap = uniqueUserTokens.filter((token) => assistantTokenSet.has(token)).length;
|
||||
return overlap / uniqueUserTokens.length >= 0.58;
|
||||
}
|
||||
|
||||
export function isGoogleMeetLikelyAssistantEchoTranscript(params: {
|
||||
|
||||
Reference in New Issue
Block a user