mirror of
https://github.com/RYDE-WORK/Langchain-Chatchat.git
synced 2026-01-31 03:03:22 +08:00
* feat:提交前端代码 * feat:提交logo样式切换 * feat:替换avatar、部分位置icon、chatchat相关说明、git链接、Wiki链接、关于、设置、反馈与建议等功能,关闭lobehub自检更新功能 * fix:移除多余代码 --------- Co-authored-by: liunux4odoo <41217877+liunux4odoo@users.noreply.github.com>
18 lines
436 B
TypeScript
18 lines
436 B
TypeScript
import { ChatStreamPayload } from '@/types/openai/chat';
|
|
|
|
export const chainTranslate = (
|
|
content: string,
|
|
targetLang: string,
|
|
): Partial<ChatStreamPayload> => ({
|
|
messages: [
|
|
{
|
|
content: '你是一名擅长翻译的助理,你需要将输入的语言翻译为目标语言',
|
|
role: 'system',
|
|
},
|
|
{
|
|
content: `请将以下内容 ${content},翻译为 ${targetLang} `,
|
|
role: 'user',
|
|
},
|
|
],
|
|
});
|