Skip to content

Commit

Permalink
feat: tool result add typeing status
Browse files Browse the repository at this point in the history
  • Loading branch information
KeJunMao committed Mar 22, 2023
1 parent 9c25674 commit cc729d1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion components/tool/ToolDetail.vue
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ defineExpose({
>
<el-scrollbar height="100%">
<div p-4 sm:p-10>
<ToolResult v-if="!tool.chat" :html="resultHtml" />
<ToolResult v-if="!tool.chat" :html="resultHtml" :loading="loading" />
<ToolChatResult
v-else
:contexts="contexts"
Expand Down
6 changes: 5 additions & 1 deletion components/tool/ToolResult.vue
Original file line number Diff line number Diff line change
@@ -1,16 +1,20 @@
<script lang="ts" setup>
defineProps<{
html: string;
loading: boolean;
}>();
</script>

<template>
<div text-base w-full>
<div prose dark:prose-invert max-w-full>
<div v-html="html"></div>
<FadeTransition>
<div v-show="loading" text-sm text-gray mt-2>OpenAI is typing...</div>
</FadeTransition>
</div>
</div>
<el-empty v-if="!html">
<el-empty v-if="!html && !loading">
<template #image>
<div
mx-auto
Expand Down

0 comments on commit cc729d1

Please sign in to comment.