mirror of
https://github.com/lobehub/lobe-chat.git
synced 2026-06-13 19:20:04 +00:00
4e522a6e2b
This commit introduces new components, modules, and features related to chat, sessions, and settings. It includes modifications to configuration files, updates to dependencies, adjustments to styles and layouts, and additions of new components and modules. The changes also involve updates to functions, interfaces, selectors, actions, and reducers. Additionally, there are modifications to TypeScript interfaces and types, as well as changes to parameters and functions in certain files.
38 lines
1.1 KiB
TypeScript
38 lines
1.1 KiB
TypeScript
import { OpenAIStreamPayload } from '@/pages/api/OpenAIStream';
|
|
import { OpenAIChatMessage } from '@/types/openai';
|
|
|
|
export const promptSummaryTitle = (
|
|
messages: OpenAIChatMessage[],
|
|
): Partial<OpenAIStreamPayload> => ({
|
|
messages: [
|
|
{
|
|
content:
|
|
'你是一名擅长会话的助理,你需要将用户的会话总结为 10 个字以内的标题,不需要包含标点符号',
|
|
role: 'system',
|
|
},
|
|
{
|
|
content: `${messages.map((message) => `${message.role}: ${message.content}`).join('\n')}
|
|
|
|
请总结上述对话为10个字以内的标题,不需要包含标点符号`,
|
|
role: 'user',
|
|
},
|
|
],
|
|
});
|
|
|
|
export const promptSummaryDescription = (
|
|
messages: OpenAIChatMessage[],
|
|
): Partial<OpenAIStreamPayload> => ({
|
|
messages: [
|
|
{
|
|
content: '你是一名擅长会话的助理,你需要将用户的会话做一个3句话以内的总结。',
|
|
role: 'system',
|
|
},
|
|
{
|
|
content: `${messages.map((message) => `${message.role}: ${message.content}`).join('\n')}
|
|
|
|
请总结上述对话内容,不超过 50 个字。`,
|
|
role: 'user',
|
|
},
|
|
],
|
|
});
|