Added TaskCategory enum

This commit is contained in:
Kostia
2023-01-07 17:25:15 +02:00
parent 7d6a8fa8d0
commit 7d014cc35b
3 changed files with 17 additions and 14 deletions
+3 -3
View File
@@ -1,6 +1,6 @@
import { CreateTask } from "./CreateTask";
import { EvaluateTask } from "./EvaluateTask";
import { TaskTypes } from "./TaskTypes";
import { TaskCategory, TaskTypes } from "./TaskTypes";
export const Task = ({ tasks, trigger, mutate, mainBgClasses }) => {
const task = tasks[0].task;
@@ -9,7 +9,7 @@ export const Task = ({ tasks, trigger, mutate, mainBgClasses }) => {
const taskType = TaskTypes.find((taskType) => taskType.type === type);
const category = taskType.category;
switch (category) {
case "create":
case TaskCategory.Create:
return (
<CreateTask
tasks={tasks}
@@ -19,7 +19,7 @@ export const Task = ({ tasks, trigger, mutate, mainBgClasses }) => {
mainBgClasses={mainBgClasses}
/>
);
case "evaluate":
case TaskCategory.Evaluate:
return <EvaluateTask tasks={tasks} trigger={trigger} mutate={mutate} mainBgClasses={mainBgClasses} />;
}
}
+11 -6
View File
@@ -1,8 +1,13 @@
export enum TaskCategory {
Create,
Evaluate,
}
export const TaskTypes = [
{
label: "Create Initial Prompts",
desc: "Write initial prompts to help Open Assistant to try replying to diverse messages.",
category: "create",
category: TaskCategory.Create,
pathname: "/create/initial_prompt",
type: "initial_prompt",
overview: "Create an initial message to send to the assistant",
@@ -11,7 +16,7 @@ export const TaskTypes = [
{
label: "Reply as User",
desc: "Chat with Open Assistant and help improve its responses as you interact with it.",
category: "create",
category: TaskCategory.Create,
pathname: "/create/user_reply",
type: "prompter_reply",
overview: "Given the following conversation, provide an adequate reply",
@@ -20,7 +25,7 @@ export const TaskTypes = [
{
label: "Reply as Assistant",
desc: "Help Open Assistant improve its responses to conversations with other users.",
category: "create",
category: TaskCategory.Create,
pathname: "/create/assistant_reply",
type: "assistant_reply",
overview: "Given the following conversation, provide an adequate reply",
@@ -28,7 +33,7 @@ export const TaskTypes = [
},
{
label: "Rank User Replies",
category: "evaluate",
category: TaskCategory.Evaluate,
desc: "Help Open Assistant improve its responses to conversations with other users.",
pathname: "/evaluate/rank_user_replies",
type: "rank_prompter_replies",
@@ -36,14 +41,14 @@ export const TaskTypes = [
{
label: "Rank Assistant Replies",
desc: "Score prompts given by Open Assistant based on their accuracy and readability.",
category: "evaluate",
category: TaskCategory.Evaluate,
pathname: "/evaluate/rank_assistant_replies",
type: "rank_assistant_replies",
},
{
label: "Rank Initial Prompts",
desc: "Score prompts given by Open Assistant based on their accuracy and readability.",
category: "evaluate",
category: TaskCategory.Evaluate,
pathname: "/evaluate/rank_initial_prompts",
type: "rank_initial_prompts",
},