fix haha
This commit is contained in:
@@ -51,10 +51,12 @@ function MessageHide({ chat }: HideMessageProps) {
|
|||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<div className="flex items-center gap-2 text-sm text-muted-foreground">
|
<div className="flex items-center gap-2 text-sm text-muted-foreground">
|
||||||
<span>{getMessageText(chat).split("\n")[0].slice(0, 28)} ...</span>
|
<span>{getMessageText(chat).trim().slice(0, 28)} ...</span>
|
||||||
</div>
|
</div>
|
||||||
<div className="flex mt-2 justify-center">
|
<div className="flex mt-2 justify-center">
|
||||||
<Badge variant="destructive">Removed from context</Badge>
|
<Badge variant="destructive">
|
||||||
|
<Tr>Removed from context</Tr>
|
||||||
|
</Badge>
|
||||||
</div>
|
</div>
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
@@ -73,7 +75,7 @@ function MessageDetail({ chat, renderMarkdown }: MessageDetailProps) {
|
|||||||
{chat.content.map((mdt) =>
|
{chat.content.map((mdt) =>
|
||||||
mdt.type === "text" ? (
|
mdt.type === "text" ? (
|
||||||
chat.hide ? (
|
chat.hide ? (
|
||||||
mdt.text?.split("\n")[0].slice(0, 16) + " ..."
|
mdt.text?.trim().slice(0, 16) + " ..."
|
||||||
) : renderMarkdown ? (
|
) : renderMarkdown ? (
|
||||||
<Markdown>{mdt.text}</Markdown>
|
<Markdown>{mdt.text}</Markdown>
|
||||||
) : (
|
) : (
|
||||||
|
|||||||
@@ -54,7 +54,9 @@ const createMessageFromCurrentBuffer = (
|
|||||||
tool_calls: tools.length > 0 ? tools : undefined,
|
tool_calls: tools.length > 0 ? tools : undefined,
|
||||||
// 补全其他必填字段的默认值(根据你的类型定义)
|
// 补全其他必填字段的默认值(根据你的类型定义)
|
||||||
hide: false,
|
hide: false,
|
||||||
token: 0, // 需要实际的token计算逻辑
|
token: calculate_token_length(
|
||||||
|
chunkMessages.join("") + reasoningChunks.join("")
|
||||||
|
), // 需要实际的token计算逻辑
|
||||||
example: false,
|
example: false,
|
||||||
audio: null,
|
audio: null,
|
||||||
logprobs: null,
|
logprobs: null,
|
||||||
@@ -284,7 +286,7 @@ export default function ChatBOX() {
|
|||||||
token: data.usage?.completion_tokens_details
|
token: data.usage?.completion_tokens_details
|
||||||
? data.usage.completion_tokens -
|
? data.usage.completion_tokens -
|
||||||
data.usage.completion_tokens_details.reasoning_tokens
|
data.usage.completion_tokens_details.reasoning_tokens
|
||||||
: (data.usage.completion_tokens ?? calculate_token_length(msg.content)),
|
: data.usage.completion_tokens ?? calculate_token_length(msg.content),
|
||||||
example: false,
|
example: false,
|
||||||
audio: null,
|
audio: null,
|
||||||
logprobs: data.choices[0]?.logprobs,
|
logprobs: data.choices[0]?.logprobs,
|
||||||
|
|||||||
@@ -141,6 +141,7 @@ const LANG_MAP: Record<string, string> = {
|
|||||||
"Configure image generation settings": "配置图片生成设置",
|
"Configure image generation settings": "配置图片生成设置",
|
||||||
"New Chat": "新对话",
|
"New Chat": "新对话",
|
||||||
"Delete Chat": "删除对话",
|
"Delete Chat": "删除对话",
|
||||||
|
"removed from context": "已从上下文中移除",
|
||||||
};
|
};
|
||||||
|
|
||||||
export default LANG_MAP;
|
export default LANG_MAP;
|
||||||
|
|||||||
Reference in New Issue
Block a user