diff --git a/frontend/crawlab-ui/src/components/core/ai/useAssistantConsole.ts b/frontend/crawlab-ui/src/components/core/ai/useAssistantConsole.ts index b7898462..dea896cc 100644 --- a/frontend/crawlab-ui/src/components/core/ai/useAssistantConsole.ts +++ b/frontend/crawlab-ui/src/components/core/ai/useAssistantConsole.ts @@ -411,11 +411,12 @@ const useAssistantConsole = () => { } }); - onMounted(() => { + const focusInput = () => { setTimeout(() => { chatInputRef.value?.focus(); - }, 200); - }); + }, 500); + }; + onMounted(focusInput); return { // Refs diff --git a/frontend/crawlab-ui/src/components/ui/chat/ChatMessageAction.vue b/frontend/crawlab-ui/src/components/ui/chat/ChatMessageAction.vue index 27b0bb7b..c82b852b 100644 --- a/frontend/crawlab-ui/src/components/ui/chat/ChatMessageAction.vue +++ b/frontend/crawlab-ui/src/components/ui/chat/ChatMessageAction.vue @@ -24,28 +24,13 @@ const actionStatusIcon = computed(() => { } }); -const parsedContent = computed(() => { +const parsedContent = computed | Record[] | null>(() => { if (!props.content) return null; - let resourceContents: ResourceContent[]; try { - resourceContents = JSON.parse(props.content); + return JSON.parse(props.content); } catch (e) { return null; } - if (!resourceContents) return null; - return resourceContents.map(resourceContent => { - const parsedResourceContent: ParsedResourceContent = { - ...resourceContent, - }; - if (typeof parsedResourceContent.text === 'string') { - try { - parsedResourceContent.text = JSON.parse(parsedResourceContent.text); - } catch (e) { - // do nothing - } - } - return parsedResourceContent; - }); }); const isJsonContent = computed(() => { @@ -101,7 +86,6 @@ defineOptions({ name: 'ClChatMessageAction' });
@@ -125,7 +109,6 @@ defineOptions({ name: 'ClChatMessageAction' }); > diff --git a/frontend/crawlab-ui/src/components/ui/chat/ChatSidebar.vue b/frontend/crawlab-ui/src/components/ui/chat/ChatSidebar.vue index cc687722..2f0c4e02 100644 --- a/frontend/crawlab-ui/src/components/ui/chat/ChatSidebar.vue +++ b/frontend/crawlab-ui/src/components/ui/chat/ChatSidebar.vue @@ -40,7 +40,7 @@ const onResizeMove = (e: MouseEvent) => { if (!isResizing.value) return; const deltaX = startX.value - e.clientX; const minWidth = props.minWidth || 350; - const maxWidth = props.maxWidth || 600; + const maxWidth = props.maxWidth || 1200; const newWidth = Math.min( Math.max(startWidth.value + deltaX, minWidth), maxWidth diff --git a/frontend/crawlab-ui/src/interfaces/models/llm.d.ts b/frontend/crawlab-ui/src/interfaces/models/llm.d.ts index f41f0ec0..101b2b79 100644 --- a/frontend/crawlab-ui/src/interfaces/models/llm.d.ts +++ b/frontend/crawlab-ui/src/interfaces/models/llm.d.ts @@ -126,13 +126,4 @@ export declare global { is_text_done?: boolean; usage?: ChatMessageUsage; } - - interface ResourceContent { - uri?: string; - text?: string; - } - - interface ParsedResourceContent extends ResourceContent { - text?: string | boolean | number | Record | Array; - } }