add new session button

This commit is contained in:
Timi
2026-09-22 21:27:33 +08:00
parent 45f77d3168
commit b54c07fe49
6 changed files with 100 additions and 54 deletions
+3 -2
View File
@@ -24,7 +24,7 @@ import { AiChatPanel, useAiChat } from "timi-tdesign-mobile";
const {
messages, isGenerating, activeToolStatus, lastError, canRetry,
sendMessage, stopGeneration, retryLastMessage
sendMessage, stopGeneration, retryLastMessage, resetConversation
} = useAiChat({
request: ({ message, signal }) => fetchReply(message, signal)
});
@@ -40,6 +40,7 @@ const {
@send="sendMessage"
@stop="stopGeneration"
@retry="retryLastMessage"
@new-conversation="resetConversation"
/>
</template>
```
@@ -63,7 +64,7 @@ const {
## 自定义
`welcome`、`composer`、`tool-status`、`message` 等插槽可以替换对应区域。`composer` 插槽会拿到 `draft`、`on-send`、`on-stop`、`on-retry` 等,便于接入自定义输入框。
`welcome`、`composer`、`tool-status`、`message` 等插槽可以替换对应区域。`composer` 插槽会拿到 `draft`、`on-send`、`on-stop`、`on-retry`、`on-new-conversation` 等,便于接入自定义输入框。
## API