perf: md解析样式

This commit is contained in:
archer
2023-03-05 15:28:46 +08:00
parent c03a7db633
commit 45ad3ba22a
5 changed files with 23 additions and 10 deletions

View File

@@ -50,6 +50,13 @@ export default async function handler(req: NextApiRequest, res: NextApiResponse)
content: item.value
})
);
// 第一句话,强调代码类型
formatPrompts.unshift({
role: ChatCompletionRequestMessageRoleEnum.System,
content:
'If the content is code or code blocks, please label the code type as accurately as possible.'
});
// 获取 chatAPI
const chatAPI = getOpenAIApi(userApiKey);
const chatResponse = await chatAPI.createChatCompletion(

View File

@@ -306,7 +306,7 @@ const Chat = () => {
isChatting={isChatting && index === chatList.length - 1}
/>
) : (
<Box whiteSpace={'pre'}>{item.value}</Box>
<Box whiteSpace={'pre-wrap'}>{item.value}</Box>
)}
</Box>
</Flex>