File size: 709 Bytes
c32ec0d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2f7798c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
export function dirtyCaptionCleaner({
  panel,
  instructions,
  caption
}: {
  panel: number;
  instructions: string;
  caption: string
}) {
  return {
    panel,
    instructions: (
      // need to remove from LLM garbage here, too
      (instructions.split(":").pop() || "")
      .replaceAll("Show a", "")
      .replaceAll("Show the", "")
      .replaceAll("Opens with a", "")
      .replaceAll("Opens with the", "")
      .replaceAll("Opens with", "")
      .replaceAll("Cut to a", "")
      .replaceAll("Cut to the", "")
      .replaceAll("Cut to", "")
      .replaceAll("End with a", "")
      .replaceAll("End with", "").trim() || ""
    ),
    caption: caption.split(":").pop()?.trim() || "",
  }
}