mirror of
https://github.com/wassname/Open-Assistant.git
synced 2026-06-27 16:10:30 +08:00
Added TaskCategory enum
This commit is contained in:
@@ -1,9 +1,9 @@
|
||||
import { Box, Flex, GridItem, Heading, SimpleGrid, Text, useColorModeValue } from "@chakra-ui/react";
|
||||
import Link from "next/link";
|
||||
|
||||
import { TaskTypes } from "../Tasks/TaskTypes";
|
||||
import { TaskCategory, TaskTypes } from "../Tasks/TaskTypes";
|
||||
|
||||
const displayTaskCategories = ["create", "evaluate"];
|
||||
const displayTaskCategories = [TaskCategory.Create, TaskCategory.Evaluate];
|
||||
|
||||
export const TaskOption = () => {
|
||||
const backgroundColor = useColorModeValue("white", "gray.700");
|
||||
@@ -12,9 +12,7 @@ export const TaskOption = () => {
|
||||
<Box className="flex flex-col gap-14" fontFamily="inter">
|
||||
{displayTaskCategories.map((category, categoryIndex) => (
|
||||
<div key={categoryIndex}>
|
||||
<Text className="text-2xl font-bold pb-4" style={{ textTransform: "capitalize" }}>
|
||||
{category}
|
||||
</Text>
|
||||
<Text className="text-2xl font-bold pb-4">{TaskCategory[category]}</Text>
|
||||
<SimpleGrid columns={[1, 2, 2, 3, 4]} gap={4}>
|
||||
{TaskTypes.filter((task) => task.category == category).map((item, itemIndex) => (
|
||||
<Link key={itemIndex} href={item.pathname}>
|
||||
|
||||
@@ -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} />;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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 it’s 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",
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user