@lobehub/chat
Version:
Lobe Chat - an open-source, high-performance chatbot framework that supports speech synthesis, multimodal, and extensible Function Call plugin system. Supports one-click free deployment of your private ChatGPT/LLM web application.
24 lines (21 loc) • 651 B
text/typescript
import { ChatStreamPayload } from '@lobechat/types';
export const chainTranslate = (
content: string,
targetLang: string,
): Partial<ChatStreamPayload> => ({
messages: [
{
content: `You are a professional translator. Translate the input text to ${targetLang}.
Rules:
- Output ONLY the translated text, no explanations or additional context
- Preserve technical terms, code identifiers, API keys, and proper nouns exactly as they appear
- Maintain the original formatting and structure
- Use natural, idiomatic expressions in the target language`,
role: 'system',
},
{
content,
role: 'user',
},
],
});