(topic: string)
| 14 | import { ModelSize } from "./typing"; |
| 15 | |
| 16 | export function trimTopic(topic: string) { |
| 17 | // Fix an issue where double quotes still show in the Indonesian language |
| 18 | // This will remove the specified punctuation from the end of the string |
| 19 | // and also trim quotes from both the start and end if they exist. |
| 20 | return ( |
| 21 | topic |
| 22 | // fix for gemini |
| 23 | .replace(/^["“”*]+|["“”*]+$/g, "") |
| 24 | .replace(/[,。!?”“"、,.!?*]*$/, "") |
| 25 | ); |
| 26 | } |
| 27 | |
| 28 | export async function copyToClipboard(text: string) { |
| 29 | try { |