This commit is contained in:
2025-11-16 22:14:11 +08:00
parent 5d2ec4ac5c
commit 98c771cab4
8 changed files with 582 additions and 76 deletions

View File

@@ -0,0 +1,29 @@
"use server";
import { getLLMAnswer } from "../ai";
export const genIPA = async (text: string) => {
return (
"[" +
(
await getLLMAnswer(
`${text}\n请生成以上文本的严式国际音标然后直接发给我不要附带任何说明不要擅自增减符号。`,
)
)
.replaceAll("[", "")
.replaceAll("]", "") +
"]"
);
};
export const genLocale = async (text: string) => {
return await getLLMAnswer(
`${text}\n推断以上文本的地区locale然后直接发给我形如如zh-CN不要附带任何说明不要擅自增减符号。`,
);
};
export const genTranslation = async (text: string, targetLanguage: string) => {
return await getLLMAnswer(
`${text}\n请将以上文本翻译到${targetLanguage},然后直接发给我,不要附带任何说明,不要擅自增减符号。`,
);
};