diff --git a/frontend/src/components/organisms/playground/basic.tsx b/frontend/src/components/organisms/playground/basic.tsx
index 556f8185bb..21263bcdaa 100644
--- a/frontend/src/components/organisms/playground/basic.tsx
+++ b/frontend/src/components/organisms/playground/basic.tsx
@@ -17,11 +17,7 @@ interface Props {
restoredTime: number;
}
-export default function BasicPromptPlayground({
- hasTemplate,
- prompt,
- restoredTime
-}: Props) {
+export default function BasicPromptPlayground({ prompt, restoredTime }: Props) {
const mode = useRecoilValue(modeState);
const setPlayground = useSetRecoilState(playgroundState);
@@ -55,7 +51,7 @@ export default function BasicPromptPlayground({
return (
@@ -63,11 +59,11 @@ export default function BasicPromptPlayground({
};
const renderFormatted = () => {
- if (hasTemplate) {
+ if (typeof prompt.template === 'string') {
return (
diff --git a/frontend/src/components/organisms/playground/editor/promptMessage.tsx b/frontend/src/components/organisms/playground/editor/promptMessage.tsx
index deacc29430..af94e1a6fe 100644
--- a/frontend/src/components/organisms/playground/editor/promptMessage.tsx
+++ b/frontend/src/components/organisms/playground/editor/promptMessage.tsx
@@ -43,7 +43,7 @@ export default function PromptMessage({
onChange(index, state)}
/>
);
diff --git a/frontend/src/components/organisms/playground/index.tsx b/frontend/src/components/organisms/playground/index.tsx
index 248eae6037..13daa7a160 100644
--- a/frontend/src/components/organisms/playground/index.tsx
+++ b/frontend/src/components/organisms/playground/index.tsx
@@ -78,7 +78,7 @@ function _PromptPlayground({ prompt }: Props) {
};
const hasTemplate = prompt?.messages
- ? prompt.messages.every((m) => typeof m.template === 'string')
+ ? !!prompt.messages.find((m) => typeof m.template === 'string')
: typeof prompt?.template === 'string';
if (!data || error) {
diff --git a/tsconfig.json b/tsconfig.json
index 9fcc9b2886..907b680ea9 100644
--- a/tsconfig.json
+++ b/tsconfig.json
@@ -1,16 +1,7 @@
{
"compilerOptions": {
- "target": "es2020",
- "lib": [
- "ESNext",
- "dom"
- ],
- "types": [
- "cypress",
- "node"
- ]
+ "lib": ["ESNext", "dom"],
+ "types": ["cypress", "node"]
},
- "include": [
- "cypress/**/*.ts"
- ]
+ "include": ["cypress/**/*.ts"]
}