Skip to content

Commit 683a830

Browse files
committed
fix: improoved style of used tools history
1 parent c5c3b44 commit 683a830

4 files changed

Lines changed: 16 additions & 16 deletions

File tree

custom/ConversationArea.vue

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,10 @@
1717

1818
</div>
1919
<AutoScrollContainer
20-
enabled
20+
:enabled="!showScrollToBottomButton"
2121
class="flex flex-col overflow-y-auto border-t border-gray-200 dark:border-gray-700"
2222
ref="scrollContainer"
23+
:threshold="10"
2324
behavior="smooth"
2425
>
2526

@@ -57,8 +58,8 @@
5758
v-if="props.messages.length === 0"
5859
class="flex-1 flex flex-col items-center justify-center text-gray-400 tracking-widest text-xl font-medium"
5960
>
60-
<p>Start the conversation</p>
61-
<p class="tracking-normal text-base text">Give any input to begin</p>
61+
<p>{{ $t('Start the conversation') }}</p>
62+
<p class="tracking-normal text-base text">{{ $t('Give any input to begin') }}</p>
6263
</div>
6364
</AutoScrollContainer>
6465
</template>
@@ -151,20 +152,16 @@ const groupToolCallParts = (message: IMessage) => {
151152
if(!part?.toolInfo) {
152153
continue;
153154
}
154-
console.log('part', part);
155155
if (part.toolInfo.toolName === currentToolName) {
156-
console.log('grouping part with tool name', currentToolName);
157156
groupedParts[groupedParts.length - 1].groupedTools.push(part);
158157
continue;
159158
}
160159
currentToolName = part.toolInfo.toolName;
161-
console.log('starting new group with tool name', currentToolName);
162160
groupedParts.push({
163161
title: currentToolName,
164162
groupedTools: [part]
165163
});
166164
}
167-
console.log('groupedParts', groupedParts);
168165
return groupedParts;
169166
}
170167

custom/Message.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<template>
22
<div
3-
class="max-w-[80%] flex px-4 py-2 m-2 rounded-xl border border-gray-200 dark:border-gray-700"
3+
class="max-w-[80%] flex px-4 m-2 rounded-xl border border-gray-200 dark:border-gray-700"
44
@click="handleMarkdownLinkClick"
55
:class="props.role === 'user' ? 'bg-lightListTableHeading dark:bg-darkListTableHeading self-end'
66
: isTypeReasoning || isTypeToolCall ? 'bg-transparent border-none self-start'

custom/ToolRenderer.vue

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
<template>
2-
<div v-if="props.data?.toolInfo" class="inline-flex m-2 max-w-[80%] flex-col gap-3 rounded-xl p-2 text-lightListTableHeadingText dark:text-darkListTableHeadingText">
2+
<div
3+
class="inline-flex m-2 max-w-[80%] flex-col gap-3 rounded-xl p-2 cursor-pointer text-lightListTableHeadingText dark:text-darkListTableHeadingText hover:opacity-75"
4+
@click="isInputOutputExpanded = !isInputOutputExpanded"
5+
>
36
<div class="flex items-center gap-3">
47
<div class="flex h-6 w-6 shrink-0 items-center justify-center rounded-full bg-white/70 dark:bg-blue-700/20">
58
<Spinner v-if="isRunning" class="h-4 w-4" />
@@ -18,8 +21,7 @@
1821
<IconAngleDownOutline
1922
v-if="hasToolSections"
2023
:class="isInputOutputExpanded ? 'rotate-180' : 'rotate-0'"
21-
class="cursor-pointer transition-transform duration-200 hover:scale-105 hover:opacity-75"
22-
@click="isInputOutputExpanded = !isInputOutputExpanded"
24+
class="cursor-pointer transition-transform duration-200 hover:scale-105"
2325
/>
2426
</div>
2527
<transition name="expand">

custom/ToolsGroup.vue

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,17 @@
11
<template>
22
<template v-for="group in props.toolGroup" :key="group.title">
3-
<div v-if="group.groupedTools.length > 1" class="mb-4 flex flex-col">
4-
<div class="flex items-center gap-2 p-2 m-2 cursor-pointer hover:opacity-75 break-all font-mono text-sm leading-5" @click="toggleGroup(group.title)">
5-
- {{ group.title }} {{ 'x' + group.groupedTools.length }}
3+
<div v-if="group.groupedTools.length > 1" class="flex flex-col">
4+
<div class="flex items-center gap-2 p-2 m-2 cursor-pointer hover:opacity-75 break-all font-mono text-sm leading-5 text-lightListTableHeadingText dark:text-darkListTableHeadingText" @click="toggleGroup(group.title)">
5+
<IconMinusOutline class="w-6 h-6 p-1"/>
6+
{{ group.title }} {{ 'x' + group.groupedTools.length }}
67
<IconAngleDownOutline
78
class="transition-transform duration-200 hover:scale-105 hover:opacity-75"
89
:class="expandedGroups.includes(group.title) ? 'rotate-180' : 'rotate-0'"
910
/>
1011
</div>
1112
<transition name="expand">
1213
<div v-show="expandedGroups.includes(group.title)" class="flex flex-col">
13-
<ToolRenderer v-for="part in group.groupedTools" :key="part.text + part.type" :data="part" />
14+
<ToolRenderer v-for="part in group.groupedTools" :key="part.text + part.type" :data="part" class="ml-8"/>
1415
</div>
1516
</transition>
1617
</div>
@@ -24,7 +25,7 @@ import { Tool } from 'langchain';
2425
import ToolRenderer from './ToolRenderer.vue';
2526
import type { IPart } from './types';
2627
import { ref } from 'vue';
27-
import { IconAngleDownOutline } from '@iconify-prerendered/vue-flowbite';
28+
import { IconAngleDownOutline, IconMinusOutline } from '@iconify-prerendered/vue-flowbite';
2829
2930
const props = defineProps<{
3031
toolGroup: {

0 commit comments

Comments
 (0)