Skip to content

Commit

Permalink
Merge branch 'main' into issue-1143/-enhance-error-message-clarify-in…
Browse files Browse the repository at this point in the history
…-playground
  • Loading branch information
bekossy committed Jan 3, 2024
2 parents 0fd1ffc + e329fcf commit 3bbc6b9
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import {
Space,
Switch,
Typography,
Tooltip,
message,
} from "antd"
import {useRouter} from "next/router"
Expand Down Expand Up @@ -247,7 +248,12 @@ const AddToTestSetDrawer: React.FC<Props> = ({params, isChatVariant, ...props})
<div className={classes.footer}>
{isChatVariant && (
<Space align="center">
<Typography.Text>Turn by Turn:</Typography.Text>
<Tooltip
placement="topLeft"
title="Add each exchange in the conversation as an individual data point"
>
<Typography.Text>Add all conversation turns:</Typography.Text>
</Tooltip>
<Switch
checked={Array.isArray(turnModeChat)}
onChange={(checked) => {
Expand Down
6 changes: 3 additions & 3 deletions agenta-web/src/components/Playground/Views/TestView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -133,9 +133,9 @@ const BoxComponent: React.FC<BoxComponentProps> = ({
})
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)
Expand Down
6 changes: 5 additions & 1 deletion agenta-web/src/lib/helpers/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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) => {
Expand Down

0 comments on commit 3bbc6b9

Please sign in to comment.