+ {chatContent?.role === 'assistant' && (
+
+ {props.isAgentThinking ? (
+
+ ) : (
+ <>
+ {chatContent.thinkingLog && (
+
+ )}
+ >
+ )}
+
+ )}
{chatContent?.role === 'user' && !isEdit && (
{chatContent.content.some(
@@ -164,8 +186,8 @@ const ChatMessage: React.FC
= (props) => {
{chatContent.content.map((content, idx) => {
if (content.contentType === 'attachment') {
- const isTextFile = TEXT_FILE_EXTENSIONS.some(
- (ext) => content.fileName?.toLowerCase().endsWith(ext)
+ const isTextFile = TEXT_FILE_EXTENSIONS.some((ext) =>
+ content.fileName?.toLowerCase().endsWith(ext)
);
return (
(
(
/>
);
-export const ProcessingIndicator = () => (
-
-);
-
export const Tools = () => {
const availableTools: AgentTool[] = [
{
@@ -88,3 +86,57 @@ export const Tools = () => {
/>
);
};
+
+export const ToolCardRunning = () => (
+
+);
+
+export const ToolCardSuccess = () => (
+
+);
+
+export const ToolCardError = () => (
+
+);
+
+export const ToolCardList = () => {
+ const tools = {
+ tool1: {
+ name: 'internet_search',
+ status: 'running' as AgentToolState,
+ input: { country: 'jp-jp', query: '東京 天気', time_limit: 'd' },
+ },
+ tool2: {
+ name: 'database_query',
+ status: 'success' as AgentToolState,
+ input: { query: 'SELECT * FROM table' },
+ // Pass the content as stringified JSON
+ content: { text: '{"result": "success", "data": "some data"}' },
+ },
+ tool4: {
+ name: 'API Call',
+ status: 'error' as AgentToolState,
+ input: { country: 'jp-jp', query: '東京 天気', time_limit: 'd' },
+ // Pass the content as simple string
+ content: { text: 'Error! Connection Timeout' },
+ },
+ };
+
+ return ;
+};
diff --git a/frontend/src/features/agent/components/AgentProcessingIndicator.tsx b/frontend/src/features/agent/components/AgentProcessingIndicator.tsx
deleted file mode 100644
index 5ca76cbb..00000000
--- a/frontend/src/features/agent/components/AgentProcessingIndicator.tsx
+++ /dev/null
@@ -1,30 +0,0 @@
-import { useTranslation } from 'react-i18next';
-import Progress from '../../../components/Progress';
-import { logisticCurve } from '../functions/logisticCurve';
-
-type Props = {
- processCount: number;
-};
-
-export const AgentProcessingIndicator = ({ processCount }: Props) => {
- const { t } = useTranslation();
- const calc = processCount == 0 ? 0 : logisticCurve(processCount - 1) * 100;
- return (
-
-
-
-
-
-
-
-
- {t('agent.progress.label')}
-
-
-
{calc.toFixed(1)} %
-
-
-
-
- );
-};
diff --git a/frontend/src/features/agent/components/AgentToolList.tsx b/frontend/src/features/agent/components/AgentToolList.tsx
new file mode 100644
index 00000000..a6a99c3b
--- /dev/null
+++ b/frontend/src/features/agent/components/AgentToolList.tsx
@@ -0,0 +1,38 @@
+import React from 'react';
+import ToolCard from './ToolCard';
+import { AgentToolsProps } from '../xstates/agentThink';
+import { useTranslation } from 'react-i18next';
+import { PiCircleNotchBold } from 'react-icons/pi';
+
+type AgentToolListProps = {
+ tools: AgentToolsProps;
+ isRunning: boolean;
+};
+
+const AgentToolList: React.FC = ({ tools, isRunning }) => {
+ const { t } = useTranslation();
+ return (
+
+ {isRunning && (
+
+
+ {t('agent.progress.label')}
+
+ )}
+
+ {Object.keys(tools).map((toolUseId) => (
+
+ ))}
+
+ );
+};
+
+export default AgentToolList;
diff --git a/frontend/src/features/agent/components/ToolCard.tsx b/frontend/src/features/agent/components/ToolCard.tsx
new file mode 100644
index 00000000..2853f5cc
--- /dev/null
+++ b/frontend/src/features/agent/components/ToolCard.tsx
@@ -0,0 +1,194 @@
+import { useTranslation } from 'react-i18next';
+import React, { useCallback } from 'react';
+import { AgentToolState } from '../xstates/agentThink';
+import { JSONTree } from 'react-json-tree';
+import {
+ PiCaretDown,
+ PiCaretUp,
+ PiCheckCircle,
+ PiCircleNotch,
+ PiXCircle,
+} from 'react-icons/pi';
+import { twMerge } from 'tailwind-merge';
+import useToolCardExpand from '../hooks/useToolCardExpand';
+
+// Theme of JSONTree
+// NOTE: need to set the theme as base16 style
+const THEME = {
+ scheme: 'aws',
+ author: 'aws',
+ base00: '#f1f3f3', // AWS Paper
+ base01: '#000000',
+ base02: '#000000',
+ base03: '#000000',
+ base04: '#000000',
+ base05: '#000000',
+ base06: '#000000',
+ base07: '#000000',
+ base08: '#000000',
+ base09: '#000000',
+ base0A: '#000000',
+ base0B: '#000000',
+ base0C: '#000000',
+ base0D: '#000000',
+ base0E: '#000000',
+ base0F: '#000000',
+};
+
+type ToolCardProps = {
+ className?: string;
+ toolUseId: string;
+ name: string;
+ status: AgentToolState;
+ input: { [key: string]: any }; // eslint-disable-line @typescript-eslint/no-explicit-any
+ content?: { text: string };
+};
+
+const ToolCard: React.FC = ({
+ className,
+ toolUseId,
+ name,
+ status,
+ input,
+ content,
+}) => {
+ const { t } = useTranslation();
+
+ // To avoid re-rendering of all ToolCard components when scrolling, we use a custom hook to manage the expanded state.
+ const {
+ expandedTools,
+ inputExpandedTools,
+ contentExpandedTools,
+ toggleExpand,
+ toggleInputExpand,
+ toggleContentExpand,
+ } = useToolCardExpand();
+
+ const isExpanded = expandedTools[toolUseId] ?? false;
+ const isInputExpanded = inputExpandedTools[toolUseId] ?? false;
+ const isContentExpanded = contentExpandedTools[toolUseId] ?? false;
+
+ const handleToggleExpand = useCallback(() => {
+ toggleExpand(toolUseId);
+ }, [toggleExpand, toolUseId]);
+
+ const handleToggleInputExpand = useCallback(() => {
+ toggleInputExpand(toolUseId);
+ }, [toggleInputExpand, toolUseId]);
+
+ const handleToggleContentExpand = useCallback(() => {
+ toggleContentExpand(toolUseId);
+ }, [toggleContentExpand, toolUseId]);
+
+ // Convert output content text to JSON object if possible.
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
+ let displayContent: any = null;
+ if (content?.text) {
+ try {
+ displayContent = JSON.parse(content.text);
+ } catch (e) {
+ displayContent = content;
+ }
+ }
+
+ return (
+
+
+
+ {status === 'running' && (
+
+ )}
+ {status === 'success' && (
+
+ )}
+ {status === 'error' &&
}
+
{name}
+
+
+ {isExpanded ? (
+
+ ) : (
+
+ )}
+
+
+
+
+ {input && (
+
+
+
{t('agent.progressCard.toolInput')}
+ {isInputExpanded ? (
+
+ ) : (
+
+ )}
+
+
+
+
+
+ {Object.entries(input).map(([key, value]) => (
+ -
+ {key}: {value}
+
+ ))}
+
+
+
+
+ )}
+
+ {(status === 'success' || status === 'error') && displayContent && (
+
+
+
{t('agent.progressCard.toolOutput')}
+ {isContentExpanded ? (
+
+ ) : (
+
+ )}
+
+
+
+ {displayContent ? (
+
+ {typeof displayContent === 'object' ? (
+ // Render as JSON tree if the content is an object. Otherwise, render as a string.
+
+ ) : (
+
{String(displayContent)}
+ )}
+
+ ) : null}
+
+
+ )}
+
+
+ );
+};
+
+export default ToolCard;
diff --git a/frontend/src/features/agent/hooks/useToolCardExpand.ts b/frontend/src/features/agent/hooks/useToolCardExpand.ts
new file mode 100644
index 00000000..17528a05
--- /dev/null
+++ b/frontend/src/features/agent/hooks/useToolCardExpand.ts
@@ -0,0 +1,72 @@
+import { create } from 'zustand';
+
+interface ToolState {
+ expandedTools: { [toolId: string]: boolean };
+ inputExpandedTools: { [toolId: string]: boolean };
+ contentExpandedTools: { [toolId: string]: boolean };
+ toggleExpand: (toolId: string) => void;
+ toggleInputExpand: (toolId: string) => void;
+ toggleContentExpand: (toolId: string) => void;
+}
+
+const useToolState = create((set) => ({
+ expandedTools: {},
+ inputExpandedTools: {},
+ contentExpandedTools: {},
+ toggleExpand: (toolId) =>
+ set((state) => {
+ const isNowExpanded = !state.expandedTools[toolId];
+ return {
+ expandedTools: {
+ ...state.expandedTools,
+ [toolId]: isNowExpanded,
+ },
+ inputExpandedTools: {
+ ...state.inputExpandedTools,
+ [toolId]: isNowExpanded,
+ },
+ contentExpandedTools: {
+ ...state.contentExpandedTools,
+ [toolId]: isNowExpanded,
+ },
+ };
+ }),
+ toggleInputExpand: (toolId) =>
+ set((state) => ({
+ inputExpandedTools: {
+ ...state.inputExpandedTools,
+ [toolId]: !state.inputExpandedTools[toolId],
+ },
+ })),
+ toggleContentExpand: (toolId) =>
+ set((state) => ({
+ contentExpandedTools: {
+ ...state.contentExpandedTools,
+ [toolId]: !state.contentExpandedTools[toolId],
+ },
+ })),
+}));
+
+const useToolCardExpand = () => {
+ const expandedTools = useToolState((state) => state.expandedTools);
+ const inputExpandedTools = useToolState((state) => state.inputExpandedTools);
+ const contentExpandedTools = useToolState(
+ (state) => state.contentExpandedTools
+ );
+ const toggleExpand = useToolState((state) => state.toggleExpand);
+ const toggleInputExpand = useToolState((state) => state.toggleInputExpand);
+ const toggleContentExpand = useToolState(
+ (state) => state.toggleContentExpand
+ );
+
+ return {
+ expandedTools,
+ inputExpandedTools,
+ contentExpandedTools,
+ toggleExpand,
+ toggleInputExpand,
+ toggleContentExpand,
+ };
+};
+
+export default useToolCardExpand;
diff --git a/frontend/src/features/agent/utils/AgentUtils.ts b/frontend/src/features/agent/utils/AgentUtils.ts
new file mode 100644
index 00000000..c7f67a54
--- /dev/null
+++ b/frontend/src/features/agent/utils/AgentUtils.ts
@@ -0,0 +1,36 @@
+import {
+ AgentMessage,
+ AgentContent,
+ AgentToolUseContent,
+ AgentToolResult,
+} from '../../../@types/conversation';
+import { AgentToolState, AgentToolsProps } from '../xstates/agentThink';
+
+export const convertThinkingLogToAgentToolProps = (
+ thinkingLog: AgentMessage[]
+): AgentToolsProps => {
+ const tools: AgentToolsProps = {};
+ thinkingLog.forEach((message) => {
+ message.content.forEach((content: AgentContent) => {
+ if (content.contentType === 'toolUse') {
+ const toolUseContent = content.body as AgentToolUseContent;
+ tools[toolUseContent.toolUseId] = {
+ name: toolUseContent.name,
+ status: 'success',
+ input: toolUseContent.input,
+ };
+ } else if (content.contentType === 'toolResult') {
+ const toolResultContent = content.body as AgentToolResult;
+ if (tools[toolResultContent.toolUseId]) {
+ tools[toolResultContent.toolUseId].status =
+ toolResultContent.status as AgentToolState;
+ tools[toolResultContent.toolUseId].content = {
+ text: toolResultContent.content.text,
+ };
+ }
+ }
+ });
+ });
+
+ return tools;
+};
diff --git a/frontend/src/features/agent/xstates/agentThink.ts b/frontend/src/features/agent/xstates/agentThink.ts
new file mode 100644
index 00000000..a42ce291
--- /dev/null
+++ b/frontend/src/features/agent/xstates/agentThink.ts
@@ -0,0 +1,122 @@
+import { setup, assign } from 'xstate';
+
+export type AgentToolsProps = {
+ // Note: key is toolUseId
+ [key: string]: {
+ name: string;
+ status: AgentToolState;
+ input: { [key: string]: any }; // eslint-disable-line @typescript-eslint/no-explicit-any
+ content?: { text: string };
+ };
+};
+
+export const AgentState = {
+ SLEEPING: 'sleeping',
+ THINKING: 'thinking',
+ LEAVING: 'leaving',
+} as const;
+
+export type AgentToolState = 'running' | 'success' | 'error';
+
+export type AgentState = (typeof AgentState)[keyof typeof AgentState];
+
+export type AgentEvent =
+ | { type: 'wakeup' }
+ | {
+ type: 'go-on';
+ toolUseId: string;
+ name: string;
+ input: { [key: string]: any }; // eslint-disable-line @typescript-eslint/no-explicit-any
+ }
+ | {
+ type: 'tool-result';
+ toolUseId: string;
+ status: AgentToolState;
+ content: { text: string };
+ }
+ | { type: 'goodbye' };
+
+export type AgentEventKeys = AgentEvent['type'];
+
+export const agentThinkingState = setup({
+ types: {
+ context: {} as {
+ tools: AgentToolsProps;
+ },
+ events: {} as AgentEvent,
+ },
+ actions: {
+ reset: assign({
+ tools: () => ({}),
+ }),
+ addTool: assign({
+ tools: ({ context, event }) => {
+ if (event.type === 'go-on') {
+ return {
+ ...context.tools,
+ [event.toolUseId]: {
+ name: event.name,
+ input: event.input,
+ status: 'running' as AgentToolState,
+ },
+ };
+ }
+ return context.tools;
+ },
+ }),
+ updateToolResult: assign({
+ tools: ({ context, event }) => {
+ if (event.type === 'tool-result') {
+ // Update status and content of the tool
+ return {
+ ...context.tools,
+ [event.toolUseId]: {
+ ...context.tools[event.toolUseId],
+ status: event.status,
+ content: event.content,
+ },
+ };
+ }
+ return context.tools;
+ },
+ }),
+ close: assign({
+ tools: () => ({}),
+ }),
+ },
+}).createMachine({
+ context: {
+ tools: {},
+ areAllToolsSuccessful: false,
+ },
+ initial: 'sleeping',
+ states: {
+ sleeping: {
+ on: {
+ wakeup: {
+ actions: 'reset',
+ target: 'thinking',
+ },
+ },
+ },
+ thinking: {
+ on: {
+ 'go-on': {
+ actions: 'addTool',
+ },
+ 'tool-result': {
+ actions: ['updateToolResult'],
+ },
+ goodbye: {
+ actions: 'close',
+ target: 'leaving',
+ },
+ },
+ },
+ leaving: {
+ after: {
+ 2500: { target: 'sleeping' },
+ },
+ },
+ },
+});
diff --git a/frontend/src/features/agent/xstates/agentThinkProgress.ts b/frontend/src/features/agent/xstates/agentThinkProgress.ts
deleted file mode 100644
index 63c780cf..00000000
--- a/frontend/src/features/agent/xstates/agentThinkProgress.ts
+++ /dev/null
@@ -1,66 +0,0 @@
-import { setup, assign } from 'xstate';
-
-export const AgentState = {
- SLEEPING: 'sleeping',
- THINKING: 'thinking',
- LEAVING: 'leaving',
-} as const;
-
-export type AgentState = (typeof AgentState)[keyof typeof AgentState];
-
-export type AgentThinkingEvent =
- | { type: 'wakeup' }
- | { type: 'go-on' }
- | { type: 'goodbye' };
-
-export type AgentThinkingEventKeys = AgentThinkingEvent['type'];
-
-export const agentThinkingState = setup({
- types: {
- context: {} as { count: number },
- events: {} as AgentThinkingEvent,
- },
- actions: {
- reset: assign({ count: () => 0 }),
- counter: assign({
- count: ({ context }) => context.count + 1,
- }),
- close: assign({
- count: () => 100,
- }),
- },
-}).createMachine({
- /** @xstate-layout N4IgpgJg5mDOIC5QAoC2BDAxgCwJYDswBKAOlgBswwAHAqAYgHd0BrMAV2oG0AGAXUShqAe1i4ALrmH5BIAB6IAjADYATCQDsKxQBZVAZmUBWHqY06ANCACeiVRp4lDADgCcixT3fLnyxQF9-KzQsPEJScTCWOnooYQBaaV4BJBARMUlpWQUEe2cSHS19fVdVVRV3IytbXNMSAxNFIyMtVT9lDUDgjBwCYhJIgmj8BjjhCAAjazBk2XSJKRlUnJL8xXd9cx4-DQ1nVWq7XZIdxS0ddbajHSMukBDe8JJKdAA3GLlYcXRxMBJ0ABmvwATshVCYeER6A8wv0Xu8RrNUvNMktQCtXGsNlsdnsDjZEM5FE4yq4vPsdModPtlIEgiB8OM4LIYX0iHNRAssstEPFlIcEPEjCRXKKxeLxfo7qynhQqLQRhyMotsog9ALnMKWooiUZ9M59opNrT6TL+oN8MMoEquWj5HYiZpvIV9lpFOCNAL9HUTK4NMZvWdXPoAqaerDSPC6DbUaqEHr1Dw9jwiTwdSm9hr8kn001jcoqbc6UA */
- context: {
- count: 0,
- },
- initial: 'sleeping',
- states: {
- sleeping: {
- on: {
- wakeup: {
- actions: 'reset',
- target: 'thinking',
- },
- },
- },
- thinking: {
- on: {
- 'go-on': [
- {
- actions: 'counter',
- },
- ],
- goodbye: {
- actions: 'close',
- target: 'leaving',
- },
- },
- },
- leaving: {
- after: {
- 2500: { target: 'sleeping' },
- },
- },
- },
-});
diff --git a/frontend/src/hooks/useChat.ts b/frontend/src/hooks/useChat.ts
index c49f0187..664566ef 100644
--- a/frontend/src/hooks/useChat.ts
+++ b/frontend/src/hooks/useChat.ts
@@ -19,7 +19,7 @@ import { convertMessageMapToArray } from '../utils/MessageUtils';
import useModel from './useModel';
import useFeedbackApi from './useFeedbackApi';
import { useMachine } from '@xstate/react';
-import { agentThinkingState } from '../features/agent/xstates/agentThinkProgress';
+import { agentThinkingState } from '../features/agent/xstates/agentThink';
type ChatStateType = {
[id: string]: MessageMap;
@@ -340,6 +340,7 @@ const useChat = () => {
model: messageContent.model,
feedback: messageContent.feedback,
usedChunks: messageContent.usedChunks,
+ thinkingLog: messageContent.thinkingLog,
}
);
};
@@ -404,6 +405,7 @@ const useChat = () => {
role: 'user',
feedback: null,
usedChunks: null,
+ thinkingLog: null,
};
const input: PostMessageRequest = {
conversationId: isNewChat ? newConversationId : conversationId,
@@ -447,7 +449,7 @@ const useChat = () => {
editMessage(conversationId, NEW_MESSAGE_ID.ASSISTANT, c);
},
thinkingDispatch: (event) => {
- send({ type: event });
+ send(event);
},
})
.then((message) => {
@@ -522,6 +524,7 @@ const useChat = () => {
role: 'user',
feedback: null,
usedChunks: null,
+ thinkingLog: null,
};
const input: PostMessageRequest = {
conversationId: conversationId,
@@ -543,7 +546,7 @@ const useChat = () => {
editMessage(conversationId, currentMessage.id, currentContentBody + c);
},
thinkingDispatch: (event) => {
- send({ type: event });
+ send(event);
},
})
.then(() => {
@@ -625,6 +628,7 @@ const useChat = () => {
model: messages[index].model,
feedback: messages[index].feedback,
usedChunks: messages[index].usedChunks,
+ thinkingLog: messages[index].thinkingLog,
}
);
} else {
@@ -642,7 +646,7 @@ const useChat = () => {
editMessage(conversationId, NEW_MESSAGE_ID.ASSISTANT, c);
},
thinkingDispatch: (event) => {
- send({ type: event });
+ send(event);
},
})
.then(() => {
diff --git a/frontend/src/hooks/usePostMessageStreaming.ts b/frontend/src/hooks/usePostMessageStreaming.ts
index 7d33b9aa..fe625c18 100644
--- a/frontend/src/hooks/usePostMessageStreaming.ts
+++ b/frontend/src/hooks/usePostMessageStreaming.ts
@@ -2,7 +2,7 @@ import { fetchAuthSession } from 'aws-amplify/auth';
import { PostMessageRequest } from '../@types/conversation';
import { create } from 'zustand';
import i18next from 'i18next';
-import { AgentThinkingEventKeys } from '../features/agent/xstates/agentThinkProgress';
+import { AgentEvent } from '../features/agent/xstates/agentThink';
import { PostStreamingStatus } from '../constants';
const WS_ENDPOINT: string = import.meta.env.VITE_APP_WS_ENDPOINT;
@@ -13,9 +13,7 @@ const usePostMessageStreaming = create<{
input: PostMessageRequest;
hasKnowledge?: boolean;
dispatch: (completion: string) => void;
- thinkingDispatch: (
- event: Exclude
- ) => void;
+ thinkingDispatch: (event: AgentEvent) => void;
}) => Promise;
}>(() => {
return {
@@ -95,8 +93,27 @@ const usePostMessageStreaming = create<{
case PostStreamingStatus.FETCHING_KNOWLEDGE:
dispatch(i18next.t('bot.label.retrievingKnowledge'));
break;
- case PostStreamingStatus.THINKING:
- thinkingDispatch('go-on');
+ case PostStreamingStatus.AGENT_THINKING:
+ Object.entries(data.log).forEach(([toolUseId, toolInfo]) => {
+ const typedToolInfo = toolInfo as {
+ name: string;
+ input: { [key: string]: any }; // eslint-disable-line @typescript-eslint/no-explicit-any
+ };
+ thinkingDispatch({
+ type: 'go-on',
+ toolUseId: toolUseId,
+ name: typedToolInfo.name,
+ input: typedToolInfo.input,
+ });
+ });
+ break;
+ case PostStreamingStatus.AGENT_TOOL_RESULT:
+ thinkingDispatch({
+ type: 'tool-result',
+ toolUseId: data.result.toolUseId,
+ status: data.result.status,
+ content: data.result.content,
+ });
break;
case PostStreamingStatus.STREAMING:
if (data.completion || data.completion === '') {
@@ -111,7 +128,9 @@ const usePostMessageStreaming = create<{
}
break;
case PostStreamingStatus.STREAMING_END:
- thinkingDispatch('goodbye');
+ thinkingDispatch({
+ type: 'goodbye',
+ });
if (completion.endsWith(i18next.t('app.chatWaitingSymbol'))) {
completion = completion.slice(0, -1);
diff --git a/frontend/src/i18n/en/index.ts b/frontend/src/i18n/en/index.ts
index 83631a0a..833e020b 100644
--- a/frontend/src/i18n/en/index.ts
+++ b/frontend/src/i18n/en/index.ts
@@ -23,7 +23,16 @@ const translation = {
},
hint: `The agent automatically determines which tools to use to answer the user's questions. Due to the time required for decision, the response time tends to be longer. Activating one or more tools enables the agent's functionality. Conversely, if no tools are selected, the agent's functionality is not utilized. When the agent's functionality is enabled, the use of "Knowledge" is also treated as one of the tools. This means that "Knowledge" may not be used in responses.`,
progress: {
- label: 'Agent Thinking...',
+ label: 'Thinking...',
+ },
+ progressCard: {
+ toolInput: 'Input: ',
+ toolOutput: 'Output: ',
+ status: {
+ running: 'Running...',
+ success: 'Success',
+ error: 'Error',
+ },
},
tools: {
get_weather: {
diff --git a/frontend/src/i18n/ja/index.ts b/frontend/src/i18n/ja/index.ts
index 82168b79..bb52dcda 100644
--- a/frontend/src/i18n/ja/index.ts
+++ b/frontend/src/i18n/ja/index.ts
@@ -26,7 +26,16 @@ const translation = {
},
hint: 'エージェントは、ユーザーの質問に答えるため、どのツールを使用するかを自動的に判断します。考える時間が必要なため、応答時間が長くなる傾向にあります。1つ以上のツールをアクティブにすると、エージェントの機能が有効になります。逆に、ツールが選択されていない場合、エージェントの機能は利用されません。エージェントの機能が有効になると、ナレッジの利用も一つのツールとして扱われます。つまり、応答の際にナレッジが利用されない場合があります。',
progress: {
- label: 'エージェント思考中...',
+ label: '思考中...',
+ },
+ progressCard: {
+ toolInput: '入力: ',
+ toolOutput: '出力: ',
+ status: {
+ running: '実行中...',
+ success: '成功',
+ error: 'エラー',
+ },
},
tools: {
get_weather: {
diff --git a/frontend/src/pages/ChatPage.tsx b/frontend/src/pages/ChatPage.tsx
index 775ace4b..996d4f72 100644
--- a/frontend/src/pages/ChatPage.tsx
+++ b/frontend/src/pages/ChatPage.tsx
@@ -38,16 +38,15 @@ import Alert from '../components/Alert';
import useBotSummary from '../hooks/useBotSummary';
import useModel from '../hooks/useModel';
import { TextInputChatContent } from '../features/agent/components/TextInputChatContent';
-import { AgentProcessingIndicator } from '../features/agent/components/AgentProcessingIndicator';
-import { AgentState } from '../features/agent/xstates/agentThinkProgress';
+import { AgentState } from '../features/agent/xstates/agentThink';
import { SyncStatus } from '../constants';
-
import { BottomHelper } from '../features/helper/components/BottomHelper';
import { useIsWindows } from '../hooks/useIsWindows';
import {
DisplayMessageContent,
PutFeedbackRequest,
} from '../@types/conversation';
+import { convertThinkingLogToAgentToolProps } from '../features/agent/utils/AgentUtils';
const MISTRAL_ENABLED: boolean =
import.meta.env.VITE_APP_ENABLE_MISTRAL === 'true';
@@ -348,8 +347,19 @@ const ChatPage: React.FC = () => {
}
})();
+ const isAgentThinking = [AgentState.THINKING, AgentState.LEAVING].some(
+ (v) => v == agentThinking.value
+ );
+ const tools = isAgentThinking
+ ? agentThinking.context.tools
+ : message.thinkingLog
+ ? convertThinkingLogToAgentToolProps(message.thinkingLog)
+ : undefined;
+
return (
{
className={`${
message.role === 'assistant' ? 'bg-aws-squid-ink/5' : ''
}`}>
- {messages.length === idx + 1 &&
- [AgentState.THINKING, AgentState.LEAVING].some(
- (v) => v == agentThinking.value
- ) ? (
-
- ) : (
- {
- if (conversationId) {
- giveFeedback(messageId, feedback);
- }
- }}
- />
- )}
-
+ {
+ if (conversationId) {
+ giveFeedback(messageId, feedback);
+ }
+ }}
+ />
))}
diff --git a/frontend/src/utils/MessageUtils.ts b/frontend/src/utils/MessageUtils.ts
index 3e82f20d..49fed1a7 100644
--- a/frontend/src/utils/MessageUtils.ts
+++ b/frontend/src/utils/MessageUtils.ts
@@ -49,6 +49,7 @@ export const convertMessageMapToArray = (
sibling: [],
feedback: messageContent.feedback,
usedChunks: messageContent.usedChunks,
+ thinkingLog: messageContent.thinkingLog,
});
key = messageContent.parent;
@@ -90,6 +91,7 @@ export const convertMessageMapToArray = (
sibling: [],
feedback: messageContent.feedback,
usedChunks: messageContent.usedChunks,
+ thinkingLog: messageContent.thinkingLog,
});
key = messageContent.children[0];
}
diff --git a/frontend/src/utils/__tests__/MessageUtils.test.ts b/frontend/src/utils/__tests__/MessageUtils.test.ts
index 8b8dbe40..a576d8b8 100644
--- a/frontend/src/utils/__tests__/MessageUtils.test.ts
+++ b/frontend/src/utils/__tests__/MessageUtils.test.ts
@@ -18,6 +18,7 @@ describe('convertMessageMapToArray', () => {
children: [],
feedback: null,
usedChunks: null,
+ thinkingLog: null,
},
};
const expected: DisplayMessageContent[] = [
@@ -36,6 +37,7 @@ describe('convertMessageMapToArray', () => {
sibling: ['1'],
feedback: null,
usedChunks: null,
+ thinkingLog: null,
},
];
const actual = convertMessageMapToArray(data, '1');
@@ -57,6 +59,7 @@ describe('convertMessageMapToArray', () => {
children: ['2'],
feedback: null,
usedChunks: null,
+ thinkingLog: null,
},
'2': {
role: 'user',
@@ -71,6 +74,7 @@ describe('convertMessageMapToArray', () => {
children: [],
feedback: null,
usedChunks: null,
+ thinkingLog: null,
},
};
const expected: DisplayMessageContent[] = [
@@ -89,6 +93,7 @@ describe('convertMessageMapToArray', () => {
sibling: ['1'],
feedback: null,
usedChunks: null,
+ thinkingLog: null,
},
{
id: '2',
@@ -105,6 +110,7 @@ describe('convertMessageMapToArray', () => {
sibling: ['2'],
feedback: null,
usedChunks: null,
+ thinkingLog: null,
},
];
const actual = convertMessageMapToArray(data, '2');
@@ -126,6 +132,7 @@ describe('convertMessageMapToArray', () => {
children: ['2'],
feedback: null,
usedChunks: null,
+ thinkingLog: null,
},
'2': {
role: 'user',
@@ -140,6 +147,7 @@ describe('convertMessageMapToArray', () => {
children: ['3'],
feedback: null,
usedChunks: null,
+ thinkingLog: null,
},
'3': {
role: 'user',
@@ -154,6 +162,7 @@ describe('convertMessageMapToArray', () => {
children: [],
feedback: null,
usedChunks: null,
+ thinkingLog: null,
},
};
const expected: DisplayMessageContent[] = [
@@ -172,6 +181,7 @@ describe('convertMessageMapToArray', () => {
sibling: ['1'],
feedback: null,
usedChunks: null,
+ thinkingLog: null,
},
{
id: '2',
@@ -188,6 +198,7 @@ describe('convertMessageMapToArray', () => {
sibling: ['2'],
feedback: null,
usedChunks: null,
+ thinkingLog: null,
},
{
id: '3',
@@ -204,6 +215,7 @@ describe('convertMessageMapToArray', () => {
sibling: ['3'],
feedback: null,
usedChunks: null,
+ thinkingLog: null,
},
];
const actual = convertMessageMapToArray(data, '3');
@@ -225,6 +237,7 @@ describe('convertMessageMapToArray', () => {
children: ['2-1', '2-2'],
feedback: null,
usedChunks: null,
+ thinkingLog: null,
},
'2-1': {
role: 'user',
@@ -239,6 +252,7 @@ describe('convertMessageMapToArray', () => {
children: [],
feedback: null,
usedChunks: null,
+ thinkingLog: null,
},
'2-2': {
role: 'user',
@@ -253,6 +267,7 @@ describe('convertMessageMapToArray', () => {
children: [],
feedback: null,
usedChunks: null,
+ thinkingLog: null,
},
};
const expected: DisplayMessageContent[] = [
@@ -271,6 +286,7 @@ describe('convertMessageMapToArray', () => {
sibling: ['1'],
feedback: null,
usedChunks: null,
+ thinkingLog: null,
},
{
id: '2-1',
@@ -287,6 +303,7 @@ describe('convertMessageMapToArray', () => {
sibling: ['2-1', '2-2'],
feedback: null,
usedChunks: null,
+ thinkingLog: null,
},
];
const actual = convertMessageMapToArray(data, '2-1');
@@ -308,6 +325,7 @@ describe('convertMessageMapToArray', () => {
children: ['2-1', '2-2'],
feedback: null,
usedChunks: null,
+ thinkingLog: null,
},
'2-1': {
role: 'user',
@@ -322,6 +340,7 @@ describe('convertMessageMapToArray', () => {
children: [],
feedback: null,
usedChunks: null,
+ thinkingLog: null,
},
'2-2': {
role: 'user',
@@ -336,6 +355,7 @@ describe('convertMessageMapToArray', () => {
children: [],
feedback: null,
usedChunks: null,
+ thinkingLog: null,
},
};
const expected: DisplayMessageContent[] = [
@@ -354,6 +374,7 @@ describe('convertMessageMapToArray', () => {
sibling: ['1'],
feedback: null,
usedChunks: null,
+ thinkingLog: null,
},
{
id: '2-2',
@@ -370,6 +391,7 @@ describe('convertMessageMapToArray', () => {
sibling: ['2-1', '2-2'],
feedback: null,
usedChunks: null,
+ thinkingLog: null,
},
];
const actual = convertMessageMapToArray(data, '2-2');
@@ -391,6 +413,7 @@ describe('convertMessageMapToArray', () => {
children: ['2-1', '2-2'],
feedback: null,
usedChunks: null,
+ thinkingLog: null,
},
'2-1': {
role: 'user',
@@ -405,6 +428,7 @@ describe('convertMessageMapToArray', () => {
children: [],
feedback: null,
usedChunks: null,
+ thinkingLog: null,
},
'2-2': {
role: 'user',
@@ -419,6 +443,7 @@ describe('convertMessageMapToArray', () => {
children: ['2-2-1'],
feedback: null,
usedChunks: null,
+ thinkingLog: null,
},
'2-2-1': {
role: 'user',
@@ -433,6 +458,7 @@ describe('convertMessageMapToArray', () => {
children: [],
feedback: null,
usedChunks: null,
+ thinkingLog: null,
},
};
const expected: DisplayMessageContent[] = [
@@ -451,6 +477,7 @@ describe('convertMessageMapToArray', () => {
sibling: ['1'],
feedback: null,
usedChunks: null,
+ thinkingLog: null,
},
{
id: '2-2',
@@ -467,6 +494,7 @@ describe('convertMessageMapToArray', () => {
sibling: ['2-1', '2-2'],
feedback: null,
usedChunks: null,
+ thinkingLog: null,
},
{
id: '2-2-1',
@@ -483,6 +511,7 @@ describe('convertMessageMapToArray', () => {
sibling: ['2-2-1'],
feedback: null,
usedChunks: null,
+ thinkingLog: null,
},
];
const actual = convertMessageMapToArray(data, '2-2-1');
@@ -504,6 +533,7 @@ describe('convertMessageMapToArray', () => {
children: ['2-1', '2-2'],
feedback: null,
usedChunks: null,
+ thinkingLog: null,
},
'2-1': {
role: 'user',
@@ -518,6 +548,7 @@ describe('convertMessageMapToArray', () => {
children: [],
feedback: null,
usedChunks: null,
+ thinkingLog: null,
},
'2-2': {
role: 'user',
@@ -532,6 +563,7 @@ describe('convertMessageMapToArray', () => {
children: ['2-2-1'],
feedback: null,
usedChunks: null,
+ thinkingLog: null,
},
'2-2-1': {
role: 'user',
@@ -546,6 +578,7 @@ describe('convertMessageMapToArray', () => {
children: [],
feedback: null,
usedChunks: null,
+ thinkingLog: null,
},
};
const expected: DisplayMessageContent[] = [
@@ -564,6 +597,7 @@ describe('convertMessageMapToArray', () => {
sibling: ['1'],
feedback: null,
usedChunks: null,
+ thinkingLog: null,
},
{
id: '2-2',
@@ -580,6 +614,7 @@ describe('convertMessageMapToArray', () => {
sibling: ['2-1', '2-2'],
feedback: null,
usedChunks: null,
+ thinkingLog: null,
},
{
id: '2-2-1',
@@ -596,6 +631,7 @@ describe('convertMessageMapToArray', () => {
sibling: ['2-2-1'],
feedback: null,
usedChunks: null,
+ thinkingLog: null,
},
];
const actual = convertMessageMapToArray(data, '2-2');
@@ -617,6 +653,7 @@ describe('convertMessageMapToArray', () => {
children: ['2-1', '2-2'],
feedback: null,
usedChunks: null,
+ thinkingLog: null,
},
'2-1': {
role: 'user',
@@ -631,6 +668,7 @@ describe('convertMessageMapToArray', () => {
children: [],
feedback: null,
usedChunks: null,
+ thinkingLog: null,
},
'2-2': {
role: 'user',
@@ -645,6 +683,7 @@ describe('convertMessageMapToArray', () => {
children: ['2-2-1'],
feedback: null,
usedChunks: null,
+ thinkingLog: null,
},
'2-2-1': {
role: 'user',
@@ -659,6 +698,7 @@ describe('convertMessageMapToArray', () => {
children: ['2-2-2'],
feedback: null,
usedChunks: null,
+ thinkingLog: null,
},
'2-2-2': {
role: 'user',
@@ -673,6 +713,7 @@ describe('convertMessageMapToArray', () => {
children: ['2-2-2-1', '2-2-2-2'],
feedback: null,
usedChunks: null,
+ thinkingLog: null,
},
'2-2-2-1': {
role: 'user',
@@ -687,6 +728,7 @@ describe('convertMessageMapToArray', () => {
children: [],
feedback: null,
usedChunks: null,
+ thinkingLog: null,
},
'2-2-2-2': {
role: 'user',
@@ -701,6 +743,7 @@ describe('convertMessageMapToArray', () => {
children: [],
feedback: null,
usedChunks: null,
+ thinkingLog: null,
},
};
const expected: DisplayMessageContent[] = [
@@ -719,6 +762,7 @@ describe('convertMessageMapToArray', () => {
sibling: ['1'],
feedback: null,
usedChunks: null,
+ thinkingLog: null,
},
{
id: '2-2',
@@ -735,6 +779,7 @@ describe('convertMessageMapToArray', () => {
sibling: ['2-1', '2-2'],
feedback: null,
usedChunks: null,
+ thinkingLog: null,
},
{
id: '2-2-1',
@@ -751,6 +796,7 @@ describe('convertMessageMapToArray', () => {
sibling: ['2-2-1'],
feedback: null,
usedChunks: null,
+ thinkingLog: null,
},
{
id: '2-2-2',
@@ -767,6 +813,7 @@ describe('convertMessageMapToArray', () => {
sibling: ['2-2-2'],
feedback: null,
usedChunks: null,
+ thinkingLog: null,
},
{
id: '2-2-2-1',
@@ -783,6 +830,7 @@ describe('convertMessageMapToArray', () => {
sibling: ['2-2-2-1', '2-2-2-2'],
feedback: null,
usedChunks: null,
+ thinkingLog: null,
},
];
const actual = convertMessageMapToArray(data, '2-2');
@@ -804,6 +852,7 @@ describe('convertMessageMapToArray', () => {
children: ['1'],
feedback: null,
usedChunks: null,
+ thinkingLog: null,
},
'1': {
role: 'user',
@@ -818,6 +867,7 @@ describe('convertMessageMapToArray', () => {
children: ['2'],
feedback: null,
usedChunks: null,
+ thinkingLog: null,
},
'2': {
role: 'user',
@@ -832,6 +882,7 @@ describe('convertMessageMapToArray', () => {
children: [],
feedback: null,
usedChunks: null,
+ thinkingLog: null,
},
};
const expected: DisplayMessageContent[] = [
@@ -850,6 +901,7 @@ describe('convertMessageMapToArray', () => {
sibling: ['1'],
feedback: null,
usedChunks: null,
+ thinkingLog: null,
},
{
id: '2',
@@ -866,6 +918,7 @@ describe('convertMessageMapToArray', () => {
sibling: ['2'],
feedback: null,
usedChunks: null,
+ thinkingLog: null,
},
];
const actual = convertMessageMapToArray(data, '2');
@@ -887,6 +940,7 @@ describe('convertMessageMapToArray', () => {
children: ['1-1', '1-2'],
feedback: null,
usedChunks: null,
+ thinkingLog: null,
},
'1-1': {
role: 'user',
@@ -901,6 +955,7 @@ describe('convertMessageMapToArray', () => {
children: ['1-1-1'],
feedback: null,
usedChunks: null,
+ thinkingLog: null,
},
'1-2': {
role: 'user',
@@ -915,6 +970,7 @@ describe('convertMessageMapToArray', () => {
children: ['1-2-1'],
feedback: null,
usedChunks: null,
+ thinkingLog: null,
},
'1-1-1': {
role: 'user',
@@ -929,6 +985,7 @@ describe('convertMessageMapToArray', () => {
children: [],
feedback: null,
usedChunks: null,
+ thinkingLog: null,
},
'1-2-1': {
role: 'user',
@@ -943,6 +1000,7 @@ describe('convertMessageMapToArray', () => {
children: [],
feedback: null,
usedChunks: null,
+ thinkingLog: null,
},
};
const expected: DisplayMessageContent[] = [
@@ -961,6 +1019,7 @@ describe('convertMessageMapToArray', () => {
sibling: ['1-1', '1-2'],
feedback: null,
usedChunks: null,
+ thinkingLog: null,
},
{
id: '1-1-1',
@@ -977,6 +1036,7 @@ describe('convertMessageMapToArray', () => {
sibling: ['1-1-1'],
feedback: null,
usedChunks: null,
+ thinkingLog: null,
},
];
const actual = convertMessageMapToArray(data, '1-1');
@@ -998,6 +1058,7 @@ describe('convertMessageMapToArray', () => {
children: ['1-1', '1-2'],
feedback: null,
usedChunks: null,
+ thinkingLog: null,
},
'1-1': {
role: 'user',
@@ -1012,6 +1073,7 @@ describe('convertMessageMapToArray', () => {
children: ['1-1-1'],
feedback: null,
usedChunks: null,
+ thinkingLog: null,
},
'1-2': {
role: 'user',
@@ -1026,6 +1088,7 @@ describe('convertMessageMapToArray', () => {
children: ['1-2-1'],
feedback: null,
usedChunks: null,
+ thinkingLog: null,
},
'1-1-1': {
role: 'user',
@@ -1040,6 +1103,7 @@ describe('convertMessageMapToArray', () => {
children: [],
feedback: null,
usedChunks: null,
+ thinkingLog: null,
},
'1-2-1': {
role: 'user',
@@ -1054,6 +1118,7 @@ describe('convertMessageMapToArray', () => {
children: [],
feedback: null,
usedChunks: null,
+ thinkingLog: null,
},
};
const expected: DisplayMessageContent[] = [
@@ -1072,6 +1137,7 @@ describe('convertMessageMapToArray', () => {
sibling: ['1-1', '1-2'],
feedback: null,
usedChunks: null,
+ thinkingLog: null,
},
{
id: '1-2-1',
@@ -1088,6 +1154,7 @@ describe('convertMessageMapToArray', () => {
sibling: ['1-2-1'],
feedback: null,
usedChunks: null,
+ thinkingLog: null,
},
];
const actual = convertMessageMapToArray(data, '1-2');
@@ -1109,6 +1176,7 @@ describe('convertMessageMapToArray', () => {
children: ['1-1', '1-2'],
feedback: null,
usedChunks: null,
+ thinkingLog: null,
},
'1-1': {
role: 'user',
@@ -1123,6 +1191,7 @@ describe('convertMessageMapToArray', () => {
children: ['1-1-1'],
feedback: null,
usedChunks: null,
+ thinkingLog: null,
},
'1-2': {
role: 'user',
@@ -1137,6 +1206,7 @@ describe('convertMessageMapToArray', () => {
children: ['1-2-1'],
feedback: null,
usedChunks: null,
+ thinkingLog: null,
},
'1-1-1': {
role: 'user',
@@ -1151,6 +1221,7 @@ describe('convertMessageMapToArray', () => {
children: [],
feedback: null,
usedChunks: null,
+ thinkingLog: null,
},
'1-2-1': {
role: 'user',
@@ -1165,6 +1236,7 @@ describe('convertMessageMapToArray', () => {
children: [],
feedback: null,
usedChunks: null,
+ thinkingLog: null,
},
};
const expected: DisplayMessageContent[] = [
@@ -1183,6 +1255,7 @@ describe('convertMessageMapToArray', () => {
sibling: ['1-1', '1-2'],
feedback: null,
usedChunks: null,
+ thinkingLog: null,
},
{
id: '1-1-1',
@@ -1199,6 +1272,7 @@ describe('convertMessageMapToArray', () => {
sibling: ['1-1-1'],
feedback: null,
usedChunks: null,
+ thinkingLog: null,
},
];
const actual = convertMessageMapToArray(data, '999');
@@ -1227,6 +1301,7 @@ describe('convertMessageMapToArray', () => {
children: ['2-1', '2-2'],
feedback: null,
usedChunks: null,
+ thinkingLog: null,
},
'2-1': {
role: 'user',
@@ -1241,6 +1316,7 @@ describe('convertMessageMapToArray', () => {
children: ['3-1', '3-2'],
feedback: null,
usedChunks: null,
+ thinkingLog: null,
},
'2-2': {
role: 'user',
@@ -1255,6 +1331,7 @@ describe('convertMessageMapToArray', () => {
children: [],
feedback: null,
usedChunks: null,
+ thinkingLog: null,
},
'3-1': {
role: 'user',
@@ -1269,6 +1346,7 @@ describe('convertMessageMapToArray', () => {
children: [],
feedback: null,
usedChunks: null,
+ thinkingLog: null,
},
'3-2': {
role: 'user',
@@ -1283,6 +1361,7 @@ describe('convertMessageMapToArray', () => {
children: [],
feedback: null,
usedChunks: null,
+ thinkingLog: null,
},
};
const expected: DisplayMessageContent[] = [
@@ -1301,6 +1380,7 @@ describe('convertMessageMapToArray', () => {
sibling: ['1'],
feedback: null,
usedChunks: null,
+ thinkingLog: null,
},
{
id: '2-1',
@@ -1317,6 +1397,7 @@ describe('convertMessageMapToArray', () => {
sibling: ['2-1', '2-2'],
feedback: null,
usedChunks: null,
+ thinkingLog: null,
},
{
id: '3-1',
@@ -1333,6 +1414,7 @@ describe('convertMessageMapToArray', () => {
sibling: ['3-1', '3-2'],
feedback: null,
usedChunks: null,
+ thinkingLog: null,
},
];
@@ -1355,6 +1437,7 @@ describe('convertMessageMapToArray', () => {
children: ['2'],
feedback: null,
usedChunks: null,
+ thinkingLog: null,
},
'2': {
role: 'user',
@@ -1369,6 +1452,7 @@ describe('convertMessageMapToArray', () => {
children: ['3'],
feedback: null,
usedChunks: null,
+ thinkingLog: null,
},
'3': {
role: 'user',
@@ -1383,6 +1467,7 @@ describe('convertMessageMapToArray', () => {
children: [],
feedback: null,
usedChunks: null,
+ thinkingLog: null,
},
};
const expected: DisplayMessageContent[] = [
@@ -1401,6 +1486,7 @@ describe('convertMessageMapToArray', () => {
sibling: ['2'],
feedback: null,
usedChunks: null,
+ thinkingLog: null,
},
{
id: '3',
@@ -1417,6 +1503,7 @@ describe('convertMessageMapToArray', () => {
sibling: ['3'],
feedback: null,
usedChunks: null,
+ thinkingLog: null,
},
];
@@ -1439,6 +1526,7 @@ describe('convertMessageMapToArray', () => {
children: ['2'],
feedback: null,
usedChunks: null,
+ thinkingLog: null,
},
'2': {
role: 'user',
@@ -1453,6 +1541,7 @@ describe('convertMessageMapToArray', () => {
children: ['4'],
feedback: null,
usedChunks: null,
+ thinkingLog: null,
},
'3': {
role: 'user',
@@ -1467,6 +1556,7 @@ describe('convertMessageMapToArray', () => {
children: [],
feedback: null,
usedChunks: null,
+ thinkingLog: null,
},
};
const expected: DisplayMessageContent[] = [
@@ -1485,6 +1575,7 @@ describe('convertMessageMapToArray', () => {
sibling: ['1'],
feedback: null,
usedChunks: null,
+ thinkingLog: null,
},
{
id: '2',
@@ -1501,6 +1592,7 @@ describe('convertMessageMapToArray', () => {
sibling: ['2'],
feedback: null,
usedChunks: null,
+ thinkingLog: null,
},
];
@@ -1523,6 +1615,7 @@ describe('convertMessageMapToArray', () => {
children: ['3'],
feedback: null,
usedChunks: null,
+ thinkingLog: null,
},
'2': {
role: 'user',
@@ -1537,6 +1630,7 @@ describe('convertMessageMapToArray', () => {
children: ['3'],
feedback: null,
usedChunks: null,
+ thinkingLog: null,
},
'3': {
role: 'user',
@@ -1551,6 +1645,7 @@ describe('convertMessageMapToArray', () => {
children: [],
feedback: null,
usedChunks: null,
+ thinkingLog: null,
},
};
const expected: DisplayMessageContent[] = [
@@ -1569,6 +1664,7 @@ describe('convertMessageMapToArray', () => {
sibling: ['2'],
feedback: null,
usedChunks: null,
+ thinkingLog: null,
},
{
id: '3',
@@ -1585,6 +1681,7 @@ describe('convertMessageMapToArray', () => {
sibling: ['3'],
feedback: null,
usedChunks: null,
+ thinkingLog: null,
},
];
@@ -1607,6 +1704,7 @@ describe('convertMessageMapToArray', () => {
children: ['2'],
feedback: null,
usedChunks: null,
+ thinkingLog: null,
},
'2': {
role: 'user',
@@ -1621,6 +1719,7 @@ describe('convertMessageMapToArray', () => {
children: ['1'],
feedback: null,
usedChunks: null,
+ thinkingLog: null,
},
'3': {
role: 'user',
@@ -1635,6 +1734,7 @@ describe('convertMessageMapToArray', () => {
children: [],
feedback: null,
usedChunks: null,
+ thinkingLog: null,
},
};
const expected: DisplayMessageContent[] = [
@@ -1653,6 +1753,7 @@ describe('convertMessageMapToArray', () => {
sibling: ['1'],
feedback: null,
usedChunks: null,
+ thinkingLog: null,
},
{
id: '2',
@@ -1669,6 +1770,7 @@ describe('convertMessageMapToArray', () => {
sibling: ['2'],
feedback: null,
usedChunks: null,
+ thinkingLog: null,
},
];