mirror of https://github.com/kortix-ai/suna.git
Update ThreadContent.tsx
This commit is contained in:
parent
a780e4c0d6
commit
d5e172e1c3
|
@ -4,11 +4,16 @@ import { ArrowDown, CircleDashed } from 'lucide-react';
|
|||
import { Button } from '@/components/ui/button';
|
||||
import { Markdown } from '@/components/ui/markdown';
|
||||
import { UnifiedMessage, ParsedContent, ParsedMetadata } from '@/components/thread/types';
|
||||
import { safeJsonParse } from '@/components/thread/utils';
|
||||
import { safeJsonParse } from '@/components/thread/utils';
|
||||
import { FileAttachmentGrid } from '@/components/thread/file-attachment';
|
||||
import { FileCache } from '@/hooks/use-cached-file';
|
||||
import { useAuth } from '@/components/AuthProvider';
|
||||
import { Project } from '@/lib/api';
|
||||
import {
|
||||
extractPrimaryParam,
|
||||
getToolIcon,
|
||||
safeJsonParse,
|
||||
} from '@/components/thread/utils';
|
||||
|
||||
// Define the set of tags whose raw XML should be hidden during streaming
|
||||
const HIDE_STREAMING_XML_TAGS = new Set([
|
||||
|
@ -138,8 +143,6 @@ export function renderMarkdownContent(
|
|||
</div>
|
||||
);
|
||||
} else {
|
||||
// Import dynamically to avoid circular dependencies
|
||||
const { getToolIcon, extractPrimaryParam } = require('@/components/thread/utils');
|
||||
const IconComponent = getToolIcon(toolName);
|
||||
const paramDisplay = extractPrimaryParam(toolName, rawXml);
|
||||
|
||||
|
@ -504,8 +507,6 @@ export const ThreadContent: React.FC<ThreadContentProps> = ({
|
|||
{streamingToolCall && !detectedTag && (
|
||||
<div className="mt-2 mb-1">
|
||||
{(() => {
|
||||
// Import dynamically to avoid circular dependencies
|
||||
const { getToolIcon, extractPrimaryParam } = require('@/components/thread/utils');
|
||||
const toolName = streamingToolCall.name || streamingToolCall.xml_tag_name || 'Tool';
|
||||
const IconComponent = getToolIcon(toolName);
|
||||
const paramDisplay = extractPrimaryParam(toolName, streamingToolCall.arguments || '');
|
||||
|
@ -672,4 +673,4 @@ export const ThreadContent: React.FC<ThreadContentProps> = ({
|
|||
);
|
||||
};
|
||||
|
||||
export default ThreadContent;
|
||||
export default ThreadContent;
|
||||
|
|
Loading…
Reference in New Issue