mirror of https://github.com/buster-so/buster.git
update some logging
This commit is contained in:
parent
2800e4a389
commit
88a467168d
|
@ -1,6 +1,7 @@
|
|||
import type { Meta, StoryObj } from '@storybook/react';
|
||||
import { StreamingMessage_File } from './StreamingMessage_File';
|
||||
import type { BusterChatResponseMessage_file } from '@/api/asset_interfaces';
|
||||
import { fn } from '@storybook/test';
|
||||
|
||||
const meta: Meta<typeof StreamingMessage_File> = {
|
||||
title: 'UI/Streaming/StreamingMessage_File',
|
||||
|
@ -48,7 +49,7 @@ export const Default: Story = {
|
|||
isSelectedFile: false,
|
||||
isCompletedStream: true,
|
||||
responseMessage: mockResponseMessage,
|
||||
onClick: () => console.log('File clicked')
|
||||
onClick: fn()
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -57,7 +58,7 @@ export const Selected: Story = {
|
|||
isSelectedFile: true,
|
||||
isCompletedStream: true,
|
||||
responseMessage: mockResponseMessage,
|
||||
onClick: () => console.log('File clicked')
|
||||
onClick: fn()
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -66,7 +67,7 @@ export const Streaming: Story = {
|
|||
isSelectedFile: false,
|
||||
isCompletedStream: false,
|
||||
responseMessage: mockResponseMessage,
|
||||
onClick: () => console.log('File clicked')
|
||||
onClick: fn()
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -78,6 +79,6 @@ export const LongFileName: Story = {
|
|||
...mockResponseMessage,
|
||||
file_name: 'very_long_file_name_that_should_truncate_in_the_ui.txt'
|
||||
},
|
||||
onClick: () => console.log('File clicked')
|
||||
onClick: fn()
|
||||
}
|
||||
};
|
||||
|
|
|
@ -37,8 +37,8 @@ export const useChatStreamMessage = () => {
|
|||
(iChatMessage: Parameters<typeof onUpdateChatMessage>[0]) => {
|
||||
onUpdateChatMessage(iChatMessage);
|
||||
console.log(
|
||||
iChatMessage.reasoning_message_ids,
|
||||
Object.keys(iChatMessage.reasoning_messages || {})
|
||||
iChatMessage.reasoning_message_ids?.length,
|
||||
Object.keys(iChatMessage.reasoning_messages || {}).length
|
||||
);
|
||||
startTransition(() => {
|
||||
//
|
||||
|
@ -191,6 +191,9 @@ export const useChatStreamMessage = () => {
|
|||
const _generatingReasoningMessageCallback = useMemoizedFn(
|
||||
(_: null, d: ChatEvent_GeneratingReasoningMessage) => {
|
||||
const { message_id, reasoning, chat_id } = d;
|
||||
if (!reasoning?.id) {
|
||||
console.log(d);
|
||||
}
|
||||
const reasoningMessageId = reasoning.id;
|
||||
const existingMessage =
|
||||
chatRef.current[chat_id]?.messages?.[message_id]?.reasoning_messages?.[reasoningMessageId];
|
||||
|
|
|
@ -4,6 +4,7 @@ import React from 'react';
|
|||
import { useChatIndividualContextSelector } from '@chatLayout/ChatContext';
|
||||
import { ReasoningMessageContainer } from './ReasoningMessageContainer';
|
||||
import { useMessageIndividual } from '@/context/Chats';
|
||||
import { useWhyDidYouUpdate } from 'ahooks';
|
||||
|
||||
interface ReasoningControllerProps {
|
||||
chatId: string;
|
||||
|
@ -15,7 +16,13 @@ export const ReasoningController: React.FC<ReasoningControllerProps> = ({ chatId
|
|||
const reasoningMessageIds = useMessageIndividual(messageId, (x) => x?.reasoning_message_ids);
|
||||
const isCompletedStream = useMessageIndividual(messageId, (x) => x?.isCompletedStream);
|
||||
|
||||
console.log('here!', hasChat, reasoningMessageIds);
|
||||
useWhyDidYouUpdate('ReasoningController', {
|
||||
hasChat,
|
||||
reasoningMessageIds,
|
||||
isCompletedStream,
|
||||
chatId,
|
||||
messageId
|
||||
});
|
||||
|
||||
if (!hasChat || !reasoningMessageIds) return <></>;
|
||||
|
||||
|
|
|
@ -30,7 +30,7 @@ const createMockReasoningFile = (
|
|||
version_id: 'v1',
|
||||
status: 'completed',
|
||||
file: {
|
||||
text: 'console.log("Hello World") \nconsole.log("Hello World") \nconsole.log("Hello World") \n',
|
||||
text: 'console.test("Hello World") \nconsole.test("Hello World") \nconsole.test("Hello World") \n',
|
||||
modified: [[1, 1]]
|
||||
},
|
||||
...overrides
|
||||
|
@ -48,7 +48,7 @@ export const Default: Story = {
|
|||
export const Loading: Story = {
|
||||
render: () => {
|
||||
const [text, setText] = React.useState(
|
||||
'function example() {\n console.log("Hello, world!");\n'
|
||||
'function example() {\n console.test("Hello, world!");\n'
|
||||
);
|
||||
|
||||
const addLine = () => {
|
||||
|
|
|
@ -130,8 +130,6 @@ export const ReasoningMessage_File: React.FC<ReasoningMessageFileProps> = React.
|
|||
processText();
|
||||
}, [text, modified]);
|
||||
|
||||
console.log(lineSegments);
|
||||
|
||||
return (
|
||||
<AppCodeBlockWrapper
|
||||
title={<ReasoningFileTitle file_name={file_name} version_number={version_number} />}
|
||||
|
|
|
@ -9,7 +9,6 @@ export const ReasoningMessage_Text: React.FC<ReasoningMessageProps> = React.memo
|
|||
const { message, status, id, type, title, secondary_title } =
|
||||
reasoningMessage as BusterChatMessageReasoning_text;
|
||||
|
||||
console.log('here', message?.length);
|
||||
return (
|
||||
<BarContainer
|
||||
showBar={true}
|
||||
|
|
Loading…
Reference in New Issue