diff --git a/src/components/ListAPI.tsx b/src/components/ListAPI.tsx
index 56398ae..81f29e0 100644
--- a/src/components/ListAPI.tsx
+++ b/src/components/ListAPI.tsx
@@ -107,37 +107,6 @@ function APIsDropdownList({
-
-
-
-
))}
diff --git a/src/components/Settings.tsx b/src/components/Settings.tsx
index cd9b34f..2e74fba 100644
--- a/src/components/Settings.tsx
+++ b/src/components/Settings.tsx
@@ -3,12 +3,7 @@ import { themeChange } from "theme-change";
import { useRef } from "react";
import { useContext, useEffect, useState, Dispatch } from "react";
import { clearTotalCost, getTotalCost } from "@/utils/totalCost";
-import {
- ChatStore,
- TemplateChatStore,
- TemplateAPI,
- TemplateTools,
-} from "@/types/chatstore";
+import { ChatStore, TemplateChatStore, TemplateTools } from "@/types/chatstore";
import { models } from "@/types/models";
import { tr, Tr, langCodeContext, LANG_OPTIONS } from "@/translate";
import { isVailedJSON } from "@/utils/isVailedJSON";
@@ -62,13 +57,13 @@ import {
DialogTrigger,
} from "@/components/ui/dialog";
import { Checkbox } from "@/components/ui/checkbox";
+import { Badge } from "@/components/ui/badge";
import { Textarea } from "@/components/ui/textarea";
import {
BanIcon,
CheckIcon,
CircleEllipsisIcon,
CogIcon,
- Ellipsis,
EyeIcon,
InfoIcon,
KeyIcon,
@@ -478,6 +473,151 @@ const Choice = (props: {
);
};
+const APIShowBlock = (props: {
+ ctx: any;
+ index: number;
+ label: string;
+ type: string;
+ apiField: string;
+ keyField: string;
+}) => {
+ return (
+
+
{props.type}
+
+
+ {props.apiField}
+
+
+
+ {props.keyField ? (
+ props.keyField
+ ) : (
+ empty
+ )}
+
+
+
+
+
+ );
+};
+
+const ToolsShowBlock = (props: {
+ ctx: any;
+ index: number;
+ label: string;
+ content: string;
+}) => {
+ return (
+
+
Tool
+
+
+
+
+
+ {JSON.stringify(JSON.parse(props.content), null, 2)}
+
+
+
+
+
+
+
+ );
+};
+
export default (props: {}) => {
const ctx = useContext(AppContext);
if (ctx === null) return <>>;
@@ -1174,6 +1314,69 @@ export default (props: {}) => {
+
+ Saved Template
+
+ {ctx.templateAPIs.map((template, index) => (
+
+ ))}
+ {ctx.templateAPIsWhisper.map((template, index) => (
+
+ ))}
+ {ctx.templateAPIsTTS.map((template, index) => (
+
+ ))}
+ {ctx.templateAPIsImageGen.map((template, index) => (
+
+ ))}
+ {ctx.templateTools.map((template, index) => (
+
+
+
+ ))}
+
+
diff --git a/src/pages/Chatbox.tsx b/src/pages/Chatbox.tsx
index 1891531..3315057 100644
--- a/src/pages/Chatbox.tsx
+++ b/src/pages/Chatbox.tsx
@@ -33,9 +33,7 @@ import {
CornerDownLeftIcon,
CornerLeftUpIcon,
CornerRightUpIcon,
- ImageIcon,
InfoIcon,
- PaintBucketIcon,
ScissorsIcon,
} from "lucide-react";
import { Switch } from "@/components/ui/switch";