Skip to content

Commit 94ef0a9

Browse files
committed
should be able to retry if there are uncaught errors
1 parent 406d946 commit 94ef0a9

File tree

3 files changed

+13
-2
lines changed

3 files changed

+13
-2
lines changed

src/assets/styles/pages/_chat-interface.scss

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,7 @@
244244
text-wrap: wrap;
245245
}
246246

247-
.show-more-btn {
247+
.btn {
248248
align-self: flex-start;
249249
border: 1px solid rgb(from var(--brand-danger) r g b / 30%);
250250
background-color: rgb(from var(--brand-danger) r g b / 5%);
@@ -258,6 +258,11 @@
258258
outline: none;
259259
box-shadow: 0 0 0 2px rgb(from var(--brand-danger) r g b / 20%);
260260
}
261+
262+
.material-symbols-outlined {
263+
font-size: 1.1rem;
264+
margin-right: 0.3rem;
265+
}
261266
}
262267
}
263268
}

src/components/ChatInterface.vue

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,10 @@
3030
>
3131
{{ showFullError ? "Show less" : "Show more" }}
3232
</button>
33+
<button class="btn" @click="() => reload()">
34+
<span class="material-symbols-outlined">refresh</span>
35+
Retry
36+
</button>
3337
</div>
3438
</div>
3539
<div
@@ -141,6 +145,7 @@ export default {
141145
askingPermission: ai.askingPermission,
142146
acceptPermission: ai.acceptPermission,
143147
rejectPermission: ai.rejectPermission,
148+
reload: ai.reload,
144149
};
145150
},
146151

src/composables/ai.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ export function useAI(options: AIOptions) {
3737

3838
let permitted = false;
3939

40-
const { messages, input, append, error, status, addToolResult, stop } =
40+
const { messages, input, append, error, status, addToolResult, stop, reload } =
4141
useChat({
4242
fetch: async (url, fetchOptions) => {
4343
if (!modelId.value) {
@@ -213,5 +213,6 @@ export function useAI(options: AIOptions) {
213213
rejectPermission,
214214
send,
215215
abort,
216+
reload,
216217
};
217218
}

0 commit comments

Comments
 (0)