You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
39 lines
921 B
39 lines
921 B
<script setup lang="ts">
|
|
import type { MessagePart } from "~/composables/useLlmChat";
|
|
|
|
const props = defineProps<{
|
|
parts: MessagePart[];
|
|
isLoading: boolean;
|
|
}>();
|
|
|
|
const emit = defineEmits<{
|
|
approve: [toolCallId: string, approved: boolean];
|
|
}>();
|
|
</script>
|
|
|
|
<template>
|
|
<template v-for="part in parts" :key="part.id">
|
|
<AgentReasoningBlock
|
|
v-if="part.type === 'reasoning'"
|
|
:text="part.text || ''"
|
|
:loading="part.reasoningLoading"
|
|
/>
|
|
|
|
<AgentToolCallBlock
|
|
v-else-if="part.type === 'tool-call'"
|
|
:part="part"
|
|
:is-loading="isLoading"
|
|
@approve="(id, approved) => emit('approve', id, approved)"
|
|
/>
|
|
|
|
<AgentToolResultBlock
|
|
v-else-if="part.type === 'tool-result' && part.result !== undefined"
|
|
:result="part.result"
|
|
/>
|
|
|
|
<AgentMarkdown
|
|
v-else-if="part.type === 'text' && part.text"
|
|
:text="part.text"
|
|
/>
|
|
</template>
|
|
</template>
|
|
|