From a4b8ed441cdef369bcf7eb3982f76522230df280 Mon Sep 17 00:00:00 2001 From: heimoshuiyu Date: Tue, 7 Jan 2025 18:58:23 +0800 Subject: [PATCH] bring Chat Template back --- src/components/ListAPI.tsx | 52 +++++++++++++++++++++++++++++++++++++- 1 file changed, 51 insertions(+), 1 deletion(-) diff --git a/src/components/ListAPI.tsx b/src/components/ListAPI.tsx index 81f29e0..d32a62a 100644 --- a/src/components/ListAPI.tsx +++ b/src/components/ListAPI.tsx @@ -1,5 +1,5 @@ import React from "react"; -import { ChatStore, TemplateAPI } from "@/types/chatstore"; +import { ChatStore, TemplateAPI, TemplateChatStore } from "@/types/chatstore"; import { Tr } from "@/translate"; import { @@ -32,6 +32,7 @@ import { import { BrushIcon } from "lucide-react"; import { useToast } from "@/hooks/use-toast"; +import { newChatStore } from "@/types/newChatstore"; interface APITemplateDropdownProps { label: string; @@ -186,6 +187,54 @@ function ToolsDropdownList() { ); } +function ChatTemplateDropdownList() { + const ctx = useContext(AppContext); + if (!ctx) return
error
; + + const { chatStore, setChatStore, templates } = ctx; + + return ( + + + Chat Template + Chat Template + + + + + + ); +} + const APIListMenu: React.FC = () => { const ctx = useContext(AppContext); if (!ctx) return
error
; @@ -194,6 +243,7 @@ const APIListMenu: React.FC = () => { {ctx.templateTools.length > 0 && } + {ctx.templates.length > 0 && } {ctx.templateAPIs.length > 0 && (