59bb7fbc12
This is once again a huge commit, but its mostly performance improvements along with some bug fixes and refactoring. It also includes changes to the theming systems. I'm still not 100% happy with the theming system, but its better than before. Model fetching has been dramatically improved! Nearly all the important computation and pre-processing has been moved to the server. This has also somehow fixed the way model details are loaded, which was causing many models to be missing their details despite models.dev having them. The markdown renderer has once again been changed, but I'm mostly certain that this is the last time major changes will be made to it. The renderer is not spamming components, bloating memory usage, and its not using a bug prone custom written chunking system. There's also a lot more that I haven't mentioned and honestly forgot. I need to get better commit hygiene tbh.
47 lines
2.3 KiB
Vue
47 lines
2.3 KiB
Vue
<script lang="ts" setup>
|
|
import type { Entity } from '@triplit/client';
|
|
import type schema from '#triplit/schema';
|
|
import Debug from './Debug.vue';
|
|
|
|
const props = defineProps<{
|
|
toolCall: Readonly<Entity<typeof schema, 'tool_calls'>>;
|
|
}>();
|
|
|
|
const deubgToolCallOpen = ref(false);
|
|
|
|
const toggleDebugToolCall = () => {
|
|
deubgToolCallOpen.value = !deubgToolCallOpen.value;
|
|
};
|
|
</script>
|
|
|
|
<template>
|
|
<div class="flex flex-col gap-2">
|
|
<div
|
|
class="select-none w-full hover:bg-[var(--color-hover)] group rounded-lg p-1 flex justify-between items-center text-[--text-tertiary] transition-colors duration-200 ease-[cubic-bezier(0.5,_1,_0.89,_1)]">
|
|
<div class="flex items-center justify-between w-full">
|
|
<div class="flex items-center gap-1">
|
|
<div
|
|
class="w-[24px] h-[24px] flex-shrink-0 rounded-lg overflow-hidden bg-[var(--bg-surface)] flex items-center justify-center">
|
|
<!-- Explicityly avoid setting the name via a reactive value, otherwise you risk corrupting the icon with that name globally -->
|
|
<Icon v-if="toolCall.status === 'pending'" name="svg-spinners:180-ring-with-bg"
|
|
class="w-3 h-3 text-[var(--text-secondary)]" />
|
|
<Icon v-else-if="toolCall.status === 'failed'" name="mynaui:x-solid"
|
|
class="w-3 h-3 text-[#ff3b3b]" />
|
|
<Icon v-else name="mynaui:tool" class="w-3 h-3 text-[var(--text-secondary)]" />
|
|
</div>
|
|
{{ toolCall.toolName }}
|
|
</div>
|
|
|
|
<div
|
|
class="flex items-center gap-1 opacity-0 group-hover:opacity-100 transition-opacity duration-200 ease-[cubic-bezier(0.5,_1,_0.89,_1)]">
|
|
<button @click="toggleDebugToolCall"
|
|
class="w-[24px] h-[24px] flex-shrink-0 rounded-lg overflow-hidden hover:bg-[var(--color-hover)] flex items-center justify-center transition-colors duration-200 ease-[cubic-bezier(0.5,_1,_0.89,_1)]">
|
|
<Icon name="mynaui:search" class="w-3 h-3 text-[var(--text-secondary)]" />
|
|
</button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<Debug v-if="deubgToolCallOpen" :toolCall="toolCall" />
|
|
</div>
|
|
</template>
|