Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error when clicking on "add to test set" with an empy chat #1141

Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@ -131,9 +131,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
Loading