@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.
32 lines (30 loc) • 658 B
text/typescript
import { ChatStreamPayload } from '@/types/openai/chat';
export const chainLangDetect = (content: string): Partial<ChatStreamPayload> => ({
messages: [
{
content:
'你是一名精通全世界语言的语言专家,你需要识别用户输入的内容,以国际标准 locale 进行输出',
role: 'system',
},
{
content: '{你好}',
role: 'user',
},
{
content: 'zh-CN',
role: 'assistant',
},
{
content: '{hello}',
role: 'user',
},
{
content: 'en-US',
role: 'assistant',
},
{
content: `{${content}}`,
role: 'user',
},
],
});