From e44b1dd4d552c5573dbd2df5234f6f0f29e18f58 Mon Sep 17 00:00:00 2001 From: Kaosiso Ezealigo Date: Fri, 29 Dec 2023 16:04:36 +0100 Subject: [PATCH 1/3] added null checks to prevent error when adding testset --- agenta-web/src/components/Playground/Views/TestView.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/agenta-web/src/components/Playground/Views/TestView.tsx b/agenta-web/src/components/Playground/Views/TestView.tsx index aa9b2fbfee..eb0e6f090b 100644 --- a/agenta-web/src/components/Playground/Views/TestView.tsx +++ b/agenta-web/src/components/Playground/Views/TestView.tsx @@ -131,9 +131,9 @@ const BoxComponent: React.FC = ({ }) params.correct_answer = result if (isChatVariant) { - const messages = testData.chat.filter((item: ChatMessage) => !!item.content) - params.chat = messages.slice(0, -1) - params.correct_answer = messages.at(-1) + const messages = testData?.chat?.filter((item: ChatMessage) => !!item.content) + params.chat = messages?.slice(0, -1) + params.correct_answer = messages?.at(-1) } onAddToTestset(params) From 38bd89ff07a56af43dd2fd9884a61b4b54b6fe7c Mon Sep 17 00:00:00 2001 From: Mahmoud Mabrouk Date: Wed, 3 Jan 2024 11:18:02 +0100 Subject: [PATCH 2/3] Refactor variable renaming in utils.ts --- agenta-web/src/lib/helpers/utils.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/agenta-web/src/lib/helpers/utils.ts b/agenta-web/src/lib/helpers/utils.ts index 79aa0e82ed..c134540994 100644 --- a/agenta-web/src/lib/helpers/utils.ts +++ b/agenta-web/src/lib/helpers/utils.ts @@ -34,7 +34,11 @@ export const getAllLlmProviderKeysAsEnvVariable = () => { } export const renameVariables = (name: string) => { - return name.charAt(0).toUpperCase() + name.slice(1).replace(/_/g, " ") + if (name === "inputs") { + return "Prompt Variables" + } else { + return name.charAt(0).toUpperCase() + name.slice(1).replace(/_/g, " ") + } } export const renameVariablesCapitalizeAll = (name: string) => { From 178e29b8f1a7f007b9943cf43a77719ea6a707c3 Mon Sep 17 00:00:00 2001 From: Mahmoud Mabrouk Date: Wed, 3 Jan 2024 11:27:54 +0100 Subject: [PATCH 3/3] Add Tooltip for adding all conversation turns in AddToTestSetDrawer --- .../Playground/AddToTestSetDrawer/AddToTestSetDrawer.tsx | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/agenta-web/src/components/Playground/AddToTestSetDrawer/AddToTestSetDrawer.tsx b/agenta-web/src/components/Playground/AddToTestSetDrawer/AddToTestSetDrawer.tsx index 6a03a069a8..2cc6c6fd7a 100644 --- a/agenta-web/src/components/Playground/AddToTestSetDrawer/AddToTestSetDrawer.tsx +++ b/agenta-web/src/components/Playground/AddToTestSetDrawer/AddToTestSetDrawer.tsx @@ -14,6 +14,7 @@ import { Space, Switch, Typography, + Tooltip, message, } from "antd" import {useRouter} from "next/router" @@ -247,7 +248,12 @@ const AddToTestSetDrawer: React.FC = ({params, isChatVariant, ...props})
{isChatVariant && ( - Turn by Turn: + + Add all conversation turns: + {