feat: expand intelligent investigation workspace
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
const compactWhitespace = (value: string) => value.replace(/\s+/g, " ").trim();
|
||||
const MAX_SPEECH_CHUNK_LENGTH = 520;
|
||||
const MIN_SPEECH_CHUNK_LENGTH = 180;
|
||||
const SPEECH_SENTENCE_PATTERN = /[^。!?!?;;\n]+(?:[。!?!?;;]+|(?=\n|$))/g;
|
||||
|
||||
export type AgentSpeechState = "idle" | "loading" | "playing" | "paused";
|
||||
@@ -93,11 +92,7 @@ export function splitSpeechTextIntoChunks(text: string): string[] {
|
||||
}
|
||||
|
||||
const candidate = currentChunk ? `${currentChunk}${segment}` : segment;
|
||||
if (
|
||||
currentChunk &&
|
||||
candidate.length > MAX_SPEECH_CHUNK_LENGTH &&
|
||||
currentChunk.length >= MIN_SPEECH_CHUNK_LENGTH
|
||||
) {
|
||||
if (currentChunk && candidate.length > MAX_SPEECH_CHUNK_LENGTH) {
|
||||
flush();
|
||||
currentChunk = segment;
|
||||
continue;
|
||||
|
||||
Reference in New Issue
Block a user