mirror of
https://github.com/BerriAI/litellm.git
synced 2026-10-12 03:48:56 +00:00
fix(ui): label the Decisions yes / no answer type instead of noul (#45931)
* fix(ui): label the Decisions yes / no answer type instead of noul Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> * refactor(ui): drop the unused NOUL_HELP constant Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> * fix(ui): say yes / no in the Decisions form validation message Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> --------- Co-authored-by: mateo <mateo@berri.ai> Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
This commit is contained in:
parent
ca0ff24726
commit
5f0e51f482
4 changed files with 7 additions and 8 deletions
|
|
@ -27,10 +27,10 @@ import {
|
|||
import type { SystemOnePayloadValidation } from "./lib/validatePayload";
|
||||
|
||||
const QUESTION_TYPES: readonly QuestionType[] = ["choice", "noul", "score"];
|
||||
const TYPE_LABELS: Record<QuestionType, string> = { choice: "Choice", noul: "noul", score: "Score" };
|
||||
const TYPE_LABELS: Record<QuestionType, string> = { choice: "Choice", noul: "Yes / no", score: "Score" };
|
||||
const TYPE_HELP: Record<QuestionType, string | undefined> = {
|
||||
choice: undefined,
|
||||
noul: "noul is a yes / no question",
|
||||
noul: "The model returns the probability that the answer is yes",
|
||||
score: undefined,
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -801,15 +801,15 @@ describe("SystemOneUI integration", () => {
|
|||
fireEvent.blur(field);
|
||||
}
|
||||
|
||||
it("explains noul on the answer type option", async () => {
|
||||
it("explains the yes / no answer type option", async () => {
|
||||
const user = userEvent.setup();
|
||||
render(<SystemOneUI accessToken="session-key" />);
|
||||
|
||||
question("has_repro_steps").getByRole("combobox", { name: "Answer type" }).focus();
|
||||
await user.keyboard("{ArrowDown}");
|
||||
expect(await screen.findByRole("option", { name: "noul" })).toHaveAttribute(
|
||||
expect(await screen.findByRole("option", { name: "Yes / no" })).toHaveAttribute(
|
||||
"title",
|
||||
"noul is a yes / no question",
|
||||
"The model returns the probability that the answer is yes",
|
||||
);
|
||||
expect(screen.getByRole("option", { name: "Choice" })).not.toHaveAttribute("title");
|
||||
});
|
||||
|
|
@ -835,7 +835,7 @@ describe("SystemOneUI integration", () => {
|
|||
fill(question("team").getByRole("textbox", { name: "Description of infra" }), "Deploys");
|
||||
|
||||
await user.click(screen.getByRole("button", { name: "Add question" }));
|
||||
await pickAnswerType(user, "question_1", "noul");
|
||||
await pickAnswerType(user, "question_1", "Yes / no");
|
||||
rename(question("question_1").getByRole("textbox", { name: "Question name" }), "urgent");
|
||||
fill(question("urgent").getByRole("textbox", { name: "Instructions" }), "Is this blocking users?");
|
||||
fill(question("urgent").getByRole("textbox", { name: "Yes means" }), "Nobody can log in");
|
||||
|
|
|
|||
|
|
@ -36,7 +36,6 @@ interface SystemOneSendVariables {
|
|||
signal: AbortSignal;
|
||||
}
|
||||
|
||||
export const NOUL_HELP = "noul is a yes / no question. The model returns the probability that the answer is yes.";
|
||||
const CUSTOM_PRESET = "custom";
|
||||
|
||||
interface PresetPickerProps {
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ const decisionQuestionSchema = z.discriminatedUnion("type", [
|
|||
criteria: z.partialRecord(z.enum(["true", "false"]), decisionsJson.nullable()).nullish(),
|
||||
})
|
||||
.refine((value) => value.instructions != null || value.criteria != null, {
|
||||
message: "A noul question requires instructions or criteria.",
|
||||
message: "A yes / no question requires instructions or criteria.",
|
||||
}),
|
||||
z.looseObject({
|
||||
type: z.literal("score"),
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue