diff --git a/website/src/components/Messages.tsx b/website/src/components/Messages.tsx index c814a6d6..bb97ab5a 100644 --- a/website/src/components/Messages.tsx +++ b/website/src/components/Messages.tsx @@ -1,10 +1,15 @@ import { Grid } from "@chakra-ui/react"; import { forwardRef, useColorMode } from "@chakra-ui/react"; import { useMemo } from "react"; -import { Message } from "src/types/Conversation"; import { FlaggableElement } from "./FlaggableElement"; +export interface Message { + text: string; + is_assistant: boolean; + message_id: string; +} + export interface ValidLabel { name: string; display_text: string; diff --git a/website/src/components/Tasks/CreateTask.tsx b/website/src/components/Tasks/CreateTask.tsx index a56432b7..e02dcdeb 100644 --- a/website/src/components/Tasks/CreateTask.tsx +++ b/website/src/components/Tasks/CreateTask.tsx @@ -3,14 +3,13 @@ import { Messages } from "src/components/Messages"; import { TaskControls } from "src/components/Survey/TaskControls"; import { TrackedTextarea } from "src/components/Survey/TrackedTextarea"; import { TwoColumnsWithCards } from "src/components/Survey/TwoColumnsWithCards"; -import {} from "src/components/Tasks/TaskTypes"; -import { TaskType } from "./TaskTypes"; +import { TaskType } from "src/components/Tasks/TaskTypes"; export interface CreateTaskProps { // we need a task type // eslint-disable-next-line @typescript-eslint/no-explicit-any tasks: any[]; - taskType: TaskInfo; + taskType: TaskType; trigger: (update: { id: string; update_type: string; content: { text: string } }) => void; onSkipTask: (task: { id: string }, reason: string) => void; onNextTask: () => void; diff --git a/website/src/components/Tasks/TaskTypes.tsx b/website/src/components/Tasks/TaskTypes.tsx index d255756a..409e7038 100644 --- a/website/src/components/Tasks/TaskTypes.tsx +++ b/website/src/components/Tasks/TaskTypes.tsx @@ -4,7 +4,7 @@ export enum TaskCategory { Label = "Label", } -export interface TaskInfo { +export interface TaskType { label: string; desc: string; category: TaskCategory; @@ -14,7 +14,7 @@ export interface TaskInfo { instruction?: string; } -export const TaskTypes: TaskInfo[] = [ +export const TaskTypes: TaskType[] = [ // create { label: "Create Initial Prompts", diff --git a/website/src/hooks/tasks/create/useCreateInitialPrompt.ts b/website/src/hooks/tasks/create/useCreateInitialPrompt.ts new file mode 100644 index 00000000..cf0193e8 --- /dev/null +++ b/website/src/hooks/tasks/create/useCreateInitialPrompt.ts @@ -0,0 +1,9 @@ +import { useGenericTaskAPI } from "../useGenericTaskAPI"; + +interface CreateInitialPromptTask { + id: string; + type: "initial_prompt"; + hint: string; +} + +export const useCreateInitialPrompt = () => useGenericTaskAPI("initial_prompt"); diff --git a/website/src/hooks/tasks/create/useCreateReply.ts b/website/src/hooks/tasks/create/useCreateReply.ts new file mode 100644 index 00000000..0bc78319 --- /dev/null +++ b/website/src/hooks/tasks/create/useCreateReply.ts @@ -0,0 +1,24 @@ +import { useGenericTaskAPI } from "../useGenericTaskAPI"; + +interface BaseCreateReplyTask { + id: string; + conversation: { + messages: Array<{ + text: string; + is_assistant: boolean; + message_id: string; + }>; + }; +} + +export interface CreateAssistantReplyTask extends BaseCreateReplyTask { + type: "assistant_reply"; +} + +export interface CreatePrompterReplyTask extends BaseCreateReplyTask { + type: "prompter_reply"; +} + +export const useCreateAssistantReply = () => useGenericTaskAPI("assistant_reply"); + +export const useCreatePrompterReply = () => useGenericTaskAPI("prompter_reply"); diff --git a/website/src/hooks/tasks/evaluate/useRankInitialPrompts.ts b/website/src/hooks/tasks/evaluate/useRankInitialPrompts.ts new file mode 100644 index 00000000..da772c80 --- /dev/null +++ b/website/src/hooks/tasks/evaluate/useRankInitialPrompts.ts @@ -0,0 +1,9 @@ +import { useGenericTaskAPI } from "../useGenericTaskAPI"; + +interface RankInitialPromptsTask { + id: string; + type: "rank_initial_prompts"; + prompts: string[]; +} + +export const useRankInitialPromptsTask = () => useGenericTaskAPI("rank_initial_prompts"); diff --git a/website/src/hooks/tasks/evaluate/useRankReplies.ts b/website/src/hooks/tasks/evaluate/useRankReplies.ts new file mode 100644 index 00000000..2d8d513f --- /dev/null +++ b/website/src/hooks/tasks/evaluate/useRankReplies.ts @@ -0,0 +1,25 @@ +import { useGenericTaskAPI } from "../useGenericTaskAPI"; + +interface BaseRankRepliesTask { + id: string; + replies: string[]; + conversation: { + messages: Array<{ + text: string; + is_assistant: boolean; + message_id: string; + }>; + }; +} + +interface RankAssistantRepliesTask extends BaseRankRepliesTask { + type: "rank_assistant_replies"; +} + +interface RankPrompterRepliesTask extends BaseRankRepliesTask { + type: "rank_prompter_replies"; +} + +export const useRankAssistantRepliesTask = () => useGenericTaskAPI("rank_assistant_replies"); + +export const useRankPrompterRepliesTask = () => useGenericTaskAPI("rank_prompter_replies"); diff --git a/website/src/hooks/tasks/labeling/useLabelAssistantReply.ts b/website/src/hooks/tasks/labeling/useLabelAssistantReply.ts new file mode 100644 index 00000000..3c44046e --- /dev/null +++ b/website/src/hooks/tasks/labeling/useLabelAssistantReply.ts @@ -0,0 +1,22 @@ +import { TaskResponse } from "../useGenericTaskAPI"; +import { LabelingTaskType, useLabelingTask } from "./useLabelingTask"; + +export interface LabelAssistantReplyTask { + id: string; + type: LabelingTaskType.label_assistant_reply; + message_id: string; + valid_labels: string[]; + reply: string; + conversation: { + messages: Array<{ + text: string; + is_assistant: boolean; + message_id: string; + }>; + }; +} + +export type LabelAssistantReplyTaskResponse = TaskResponse; + +export const useLabelAssistantReplyTask = () => + useLabelingTask(LabelingTaskType.label_assistant_reply); diff --git a/website/src/hooks/tasks/labeling/useLabelInitialPrompt.tsx b/website/src/hooks/tasks/labeling/useLabelInitialPrompt.tsx new file mode 100644 index 00000000..f7ba8ab5 --- /dev/null +++ b/website/src/hooks/tasks/labeling/useLabelInitialPrompt.tsx @@ -0,0 +1,15 @@ +import { TaskResponse } from "../useGenericTaskAPI"; +import { LabelingTaskType, useLabelingTask } from "./useLabelingTask"; + +export interface LabelInitialPromptTask { + id: string; + type: LabelingTaskType.label_initial_prompt; + message_id: string; + valid_labels: string[]; + prompt: string; +} + +export type LabelInitialPromptTaskResponse = TaskResponse; + +export const useLabelInitialPromptTask = () => + useLabelingTask(LabelingTaskType.label_initial_prompt); diff --git a/website/src/hooks/tasks/labeling/useLabelPrompterReply.ts b/website/src/hooks/tasks/labeling/useLabelPrompterReply.ts new file mode 100644 index 00000000..9de2057f --- /dev/null +++ b/website/src/hooks/tasks/labeling/useLabelPrompterReply.ts @@ -0,0 +1,22 @@ +import { TaskResponse } from "../useGenericTaskAPI"; +import { LabelingTaskType, useLabelingTask } from "./useLabelingTask"; + +export interface LabelPrompterReplyTask { + id: string; + type: LabelingTaskType.label_prompter_reply; + message_id: string; + valid_labels: string[]; + reply: string; + conversation: { + messages: Array<{ + text: string; + is_assistant: boolean; + message_id: string; + }>; + }; +} + +export type LabelPrompterReplyTaskResponse = TaskResponse; + +export const useLabelPrompterReplyTask = () => + useLabelingTask(LabelingTaskType.label_prompter_reply); diff --git a/website/src/hooks/tasks/labeling/useLabelingTask.ts b/website/src/hooks/tasks/labeling/useLabelingTask.ts new file mode 100644 index 00000000..27555284 --- /dev/null +++ b/website/src/hooks/tasks/labeling/useLabelingTask.ts @@ -0,0 +1,20 @@ +import { useGenericTaskAPI } from "../useGenericTaskAPI"; + +export const enum LabelingTaskType { + label_initial_prompt = "label_initial_prompt", + label_prompter_reply = "label_prompter_reply", + label_assistant_reply = "label_assistant_reply", +} + +export const useLabelingTask = (endpoint: LabelingTaskType) => { + const { tasks, isLoading, trigger, reset, error } = useGenericTaskAPI(endpoint); + + const submit = (id: string, message_id: string, text: string, validLabels: string[], labelWeights: number[]) => { + console.assert(validLabels.length === labelWeights.length); + const labels = Object.fromEntries(validLabels.map((label, i) => [label, labelWeights[i]])); + + return trigger({ id, update_type: "text_labels", content: { labels, text, message_id } }); + }; + + return { tasks, isLoading, submit, reset, error }; +}; diff --git a/website/src/hooks/tasks/useCreateReply.ts b/website/src/hooks/tasks/useCreateReply.ts deleted file mode 100644 index 23bc041d..00000000 --- a/website/src/hooks/tasks/useCreateReply.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { TaskType } from "src/types/Task"; -import { CreateAssistantReplyTask, CreateInitialPromptTask, CreatePrompterReplyTask } from "src/types/Tasks"; - -import { useGenericTaskAPI } from "./useGenericTaskAPI"; - -export const useCreateAssistantReply = () => useGenericTaskAPI(TaskType.assistant_reply); -export const useCreatePrompterReply = () => useGenericTaskAPI(TaskType.prompter_reply); -export const useCreateInitialPrompt = () => useGenericTaskAPI(TaskType.initial_prompt); diff --git a/website/src/hooks/tasks/useGenericTaskAPI.tsx b/website/src/hooks/tasks/useGenericTaskAPI.tsx index 4b9b3bae..e300e220 100644 --- a/website/src/hooks/tasks/useGenericTaskAPI.tsx +++ b/website/src/hooks/tasks/useGenericTaskAPI.tsx @@ -2,11 +2,19 @@ import { useState } from "react"; import type { ValidLabel } from "src/components/Messages"; import fetcher from "src/lib/fetcher"; import poster from "src/lib/poster"; -import { BaseTask, TaskResponse } from "src/types/Task"; import useSWRImmutable from "swr/immutable"; import useSWRMutation from "swr/mutation"; -export const useGenericTaskAPI = (taskApiEndpoint: string) => { +// TODO: type & centralize types for all tasks + +export interface TaskResponse { + id: string; + userId: string; + task: TaskType; + valid_labels: ValidLabel[]; +} + +export const useGenericTaskAPI = (taskApiEndpoint: string) => { type ConcreteTaskResponse = TaskResponse; const [tasks, setTasks] = useState([]); diff --git a/website/src/hooks/tasks/useLabelingTask.ts b/website/src/hooks/tasks/useLabelingTask.ts deleted file mode 100644 index 5e5050ab..00000000 --- a/website/src/hooks/tasks/useLabelingTask.ts +++ /dev/null @@ -1,32 +0,0 @@ -import { BaseTask, TaskResponse, TaskType } from "src/types/Task"; -import { LabelAssistantReplyTask, LabelInitialPromptTask, LabelPrompterReplyTask } from "src/types/Tasks"; - -import { useGenericTaskAPI } from "./useGenericTaskAPI"; - -const useLabelingTask = ( - endpoint: TaskType.label_assistant_reply | TaskType.label_prompter_reply | TaskType.label_initial_prompt -) => { - const { tasks, isLoading, trigger, reset, error } = useGenericTaskAPI(endpoint); - - const submit = (id: string, message_id: string, text: string, validLabels: string[], labelWeights: number[]) => { - console.assert(validLabels.length === labelWeights.length); - const labels = Object.fromEntries(validLabels.map((label, i) => [label, labelWeights[i]])); - - return trigger({ id, update_type: "text_labels", content: { labels, text, message_id } }); - }; - - return { tasks, isLoading, submit, reset, error }; -}; - -export type LabelAssistantReplyTaskResponse = TaskResponse; - -export const useLabelAssistantReplyTask = () => - useLabelingTask(TaskType.label_assistant_reply); - -export type LabelInitialPromptTaskResponse = TaskResponse; - -export const useLabelInitialPromptTask = () => useLabelingTask(TaskType.label_initial_prompt); - -export type LabelPrompterReplyTaskResponse = TaskResponse; - -export const useLabelPrompterReplyTask = () => useLabelingTask(TaskType.label_prompter_reply); diff --git a/website/src/hooks/tasks/useRankReplies.ts b/website/src/hooks/tasks/useRankReplies.ts deleted file mode 100644 index d4accda0..00000000 --- a/website/src/hooks/tasks/useRankReplies.ts +++ /dev/null @@ -1,12 +0,0 @@ -import { TaskType } from "src/types/Task"; -import { RankAssistantRepliesTask, RankInitialPromptsTask, RankPrompterRepliesTask } from "src/types/Tasks"; - -import { useGenericTaskAPI } from "./useGenericTaskAPI"; - -export const useRankAssistantRepliesTask = () => - useGenericTaskAPI(TaskType.rank_assistant_replies); - -export const useRankPrompterRepliesTask = () => - useGenericTaskAPI(TaskType.rank_prompter_replies); - -export const useRankInitialPromptsTask = () => useGenericTaskAPI(TaskType.rank_initial_prompts); diff --git a/website/src/pages/create/assistant_reply.tsx b/website/src/pages/create/assistant_reply.tsx index 17facd5d..e9aee226 100644 --- a/website/src/pages/create/assistant_reply.tsx +++ b/website/src/pages/create/assistant_reply.tsx @@ -3,7 +3,7 @@ import { useColorMode } from "@chakra-ui/react"; import Head from "next/head"; import { LoadingScreen } from "src/components/Loading/LoadingScreen"; import { Task } from "src/components/Tasks/Task"; -import { useCreateAssistantReply } from "src/hooks/tasks/useCreateReply"; +import { useCreateAssistantReply } from "src/hooks/tasks/create/useCreateReply"; const AssistantReply = () => { const { tasks, isLoading, reset, trigger } = useCreateAssistantReply(); diff --git a/website/src/pages/create/initial_prompt.tsx b/website/src/pages/create/initial_prompt.tsx index 57f0dabd..efea6474 100644 --- a/website/src/pages/create/initial_prompt.tsx +++ b/website/src/pages/create/initial_prompt.tsx @@ -3,7 +3,7 @@ import { useColorMode } from "@chakra-ui/react"; import Head from "next/head"; import { LoadingScreen } from "src/components/Loading/LoadingScreen"; import { Task } from "src/components/Tasks/Task"; -import { useCreateInitialPrompt } from "src/hooks/tasks/useCreateReply"; +import { useCreateInitialPrompt } from "src/hooks/tasks/create/useCreateInitialPrompt"; const InitialPrompt = () => { const { tasks, isLoading, reset, trigger } = useCreateInitialPrompt(); diff --git a/website/src/pages/create/user_reply.tsx b/website/src/pages/create/user_reply.tsx index a0af0e95..2394bd63 100644 --- a/website/src/pages/create/user_reply.tsx +++ b/website/src/pages/create/user_reply.tsx @@ -3,7 +3,7 @@ import Head from "next/head"; import { Container } from "src/components/Container"; import { LoadingScreen } from "src/components/Loading/LoadingScreen"; import { Task } from "src/components/Tasks/Task"; -import { useCreatePrompterReply } from "src/hooks/tasks/useCreateReply"; +import { useCreatePrompterReply } from "src/hooks/tasks/create/useCreateReply"; const UserReply = () => { const { tasks, isLoading, reset, trigger } = useCreatePrompterReply(); diff --git a/website/src/pages/evaluate/rank_assistant_replies.tsx b/website/src/pages/evaluate/rank_assistant_replies.tsx index 8546e7a6..931c9194 100644 --- a/website/src/pages/evaluate/rank_assistant_replies.tsx +++ b/website/src/pages/evaluate/rank_assistant_replies.tsx @@ -3,7 +3,7 @@ import Head from "next/head"; import { Container } from "src/components/Container"; import { LoadingScreen } from "src/components/Loading/LoadingScreen"; import { Task } from "src/components/Tasks/Task"; -import { useRankAssistantRepliesTask } from "src/hooks/tasks/useRankReplies"; +import { useRankAssistantRepliesTask } from "src/hooks/tasks/evaluate/useRankReplies"; const RankAssistantReplies = () => { const { tasks, isLoading, reset, trigger } = useRankAssistantRepliesTask(); diff --git a/website/src/pages/evaluate/rank_initial_prompts.tsx b/website/src/pages/evaluate/rank_initial_prompts.tsx index 1898a93a..4b717143 100644 --- a/website/src/pages/evaluate/rank_initial_prompts.tsx +++ b/website/src/pages/evaluate/rank_initial_prompts.tsx @@ -3,7 +3,7 @@ import Head from "next/head"; import { Container } from "src/components/Container"; import { LoadingScreen } from "src/components/Loading/LoadingScreen"; import { Task } from "src/components/Tasks/Task"; -import { useRankInitialPromptsTask } from "src/hooks/tasks/useRankReplies"; +import { useRankInitialPromptsTask } from "src/hooks/tasks/evaluate/useRankInitialPrompts"; const RankInitialPrompts = () => { const { tasks, isLoading, reset, trigger } = useRankInitialPromptsTask(); diff --git a/website/src/pages/evaluate/rank_user_replies.tsx b/website/src/pages/evaluate/rank_user_replies.tsx index e2a39977..659874a2 100644 --- a/website/src/pages/evaluate/rank_user_replies.tsx +++ b/website/src/pages/evaluate/rank_user_replies.tsx @@ -3,7 +3,7 @@ import Head from "next/head"; import { Container } from "src/components/Container"; import { LoadingScreen } from "src/components/Loading/LoadingScreen"; import { Task } from "src/components/Tasks/Task"; -import { useRankPrompterRepliesTask } from "src/hooks/tasks/useRankReplies"; +import { useRankPrompterRepliesTask } from "src/hooks/tasks/evaluate/useRankReplies"; const RankUserReplies = () => { const { tasks, isLoading, reset, trigger } = useRankPrompterRepliesTask(); diff --git a/website/src/pages/label/label_assistant_reply.tsx b/website/src/pages/label/label_assistant_reply.tsx index 99c10f56..89b612ca 100644 --- a/website/src/pages/label/label_assistant_reply.tsx +++ b/website/src/pages/label/label_assistant_reply.tsx @@ -1,10 +1,13 @@ import { useState } from "react"; import { LoadingScreen } from "src/components/Loading/LoadingScreen"; +import { Message } from "src/components/Messages"; import { MessageTable } from "src/components/Messages/MessageTable"; import { TaskControls } from "src/components/Survey/TaskControls"; import { LabelSliderGroup, LabelTask } from "src/components/Tasks/LabelTask"; -import { LabelAssistantReplyTaskResponse, useLabelAssistantReplyTask } from "src/hooks/tasks/useLabelingTask"; -import { Message } from "src/types/Conversation"; +import { + LabelAssistantReplyTaskResponse, + useLabelAssistantReplyTask, +} from "src/hooks/tasks/labeling/useLabelAssistantReply"; const LabelAssistantReply = () => { const [sliderValues, setSliderValues] = useState([]); diff --git a/website/src/pages/label/label_initial_prompt.tsx b/website/src/pages/label/label_initial_prompt.tsx index 4cd4343b..3c791f23 100644 --- a/website/src/pages/label/label_initial_prompt.tsx +++ b/website/src/pages/label/label_initial_prompt.tsx @@ -3,7 +3,10 @@ import { LoadingScreen } from "src/components/Loading/LoadingScreen"; import { MessageView } from "src/components/Messages"; import { TaskControls } from "src/components/Survey/TaskControls"; import { LabelSliderGroup, LabelTask } from "src/components/Tasks/LabelTask"; -import { LabelInitialPromptTaskResponse, useLabelInitialPromptTask } from "src/hooks/tasks/useLabelingTask"; +import { + LabelInitialPromptTaskResponse, + useLabelInitialPromptTask, +} from "src/hooks/tasks/labeling/useLabelInitialPrompt"; const LabelInitialPrompt = () => { const [sliderValues, setSliderValues] = useState([]); diff --git a/website/src/pages/label/label_prompter_reply.tsx b/website/src/pages/label/label_prompter_reply.tsx index 35654a47..812a3fcc 100644 --- a/website/src/pages/label/label_prompter_reply.tsx +++ b/website/src/pages/label/label_prompter_reply.tsx @@ -1,10 +1,13 @@ import { useState } from "react"; import { LoadingScreen } from "src/components/Loading/LoadingScreen"; +import { Message } from "src/components/Messages"; import { MessageTable } from "src/components/Messages/MessageTable"; import { TaskControls } from "src/components/Survey/TaskControls"; import { LabelSliderGroup, LabelTask } from "src/components/Tasks/LabelTask"; -import { LabelPrompterReplyTaskResponse, useLabelPrompterReplyTask } from "src/hooks/tasks/useLabelingTask"; -import { Message } from "src/types/Conversation"; +import { + LabelPrompterReplyTaskResponse, + useLabelPrompterReplyTask, +} from "src/hooks/tasks/labeling/useLabelPrompterReply"; const LabelPrompterReply = () => { const [sliderValues, setSliderValues] = useState([]); diff --git a/website/src/pages/messages/index.tsx b/website/src/pages/messages/index.tsx index ed48d47b..28ec9c54 100644 --- a/website/src/pages/messages/index.tsx +++ b/website/src/pages/messages/index.tsx @@ -2,9 +2,9 @@ import { Box, CircularProgress, SimpleGrid, Text, useColorModeValue } from "@cha import Head from "next/head"; import { useEffect, useState } from "react"; import { getDashboardLayout } from "src/components/Layout"; +import { Message } from "src/components/Messages"; import { MessageTable } from "src/components/Messages/MessageTable"; import fetcher from "src/lib/fetcher"; -import { Message } from "src/types/Conversation"; import useSWRImmutable from "swr/immutable"; const MessagesDashboard = () => { @@ -82,6 +82,6 @@ const MessagesDashboard = () => { ); }; -MessagesDashboard.getLayout = getDashboardLayout; +MessagesDashboard.getLayout = (page) => getDashboardLayout(page); export default MessagesDashboard; diff --git a/website/src/types/Conversation.ts b/website/src/types/Conversation.ts deleted file mode 100644 index f12b2781..00000000 --- a/website/src/types/Conversation.ts +++ /dev/null @@ -1,9 +0,0 @@ -export interface Message { - text: string; - is_assistant: boolean; - message_id: string; -} - -export interface Conversation { - messages: Message[]; -} diff --git a/website/src/types/Task.ts b/website/src/types/Task.ts deleted file mode 100644 index 0dca6a5b..00000000 --- a/website/src/types/Task.ts +++ /dev/null @@ -1,24 +0,0 @@ -export const enum TaskType { - initial_prompt = "initial_prompt", - assistant_reply = "assistant_reply", - prompter_reply = "prompter_reply", - - rank_initial_prompts = "rank_initial_prompts", - rank_assistant_replies = "rank_assistant_replies", - rank_prompter_replies = "rank_prompter_replies", - - label_initial_prompt = "label_initial_prompt", - label_prompter_reply = "label_prompter_reply", - label_assistant_reply = "label_assistant_reply", -} - -export interface BaseTask { - id: string; - type: TaskType; -} - -export interface TaskResponse { - id: string; - userId: string; - task: Task; -} diff --git a/website/src/types/Tasks.ts b/website/src/types/Tasks.ts deleted file mode 100644 index 50c251bb..00000000 --- a/website/src/types/Tasks.ts +++ /dev/null @@ -1,57 +0,0 @@ -import { Conversation } from "./Conversation"; -import { BaseTask, TaskType } from "./Task"; - -export interface CreateInitialPromptTask extends BaseTask { - type: TaskType.initial_prompt; - hint: string; -} - -export interface CreateAssistantReplyTask extends BaseTask { - type: TaskType.assistant_reply; - conversation: Conversation; -} - -export interface CreatePrompterReplyTask extends BaseTask { - type: TaskType.prompter_reply; - conversation: Conversation; -} - -export interface RankInitialPromptsTask extends BaseTask { - type: TaskType.rank_initial_prompts; - prompts: string[]; -} - -export interface RankAssistantRepliesTask extends BaseTask { - type: TaskType.rank_assistant_replies; - conversation: Conversation; - replies: string[]; -} - -export interface RankPrompterRepliesTask extends BaseTask { - type: TaskType.rank_prompter_replies; - conversation: Conversation; - replies: string[]; -} - -export interface LabelAssistantReplyTask extends BaseTask { - type: TaskType.label_assistant_reply; - message_id: string; - conversation: Conversation; - reply: string; - valid_labels: string[]; -} - -export interface LabelInitialPromptTask extends BaseTask { - type: TaskType.label_initial_prompt; - message_id: string; - valid_labels: string[]; - prompt: string; -} - -export interface LabelPrompterReplyTask extends BaseTask { - type: TaskType.label_prompter_reply; - message_id: string; - conversation: Conversation; - reply: string; - valid_labels: string[]; -}