mirror of
https://github.com/wassname/Open-Assistant.git
synced 2026-07-04 17:20:19 +08:00
Merge pull request #188 from k-nearest-neighbor/fixes_for_breaking_change_182
Fixes for breaking changes in #182
This commit is contained in:
@@ -62,7 +62,7 @@ const handler = async (req, res) => {
|
||||
"Content-Type": "application/json",
|
||||
},
|
||||
body: JSON.stringify({
|
||||
post_id: registeredTask.id,
|
||||
message_id: registeredTask.id,
|
||||
}),
|
||||
});
|
||||
const ack = await ackRes.json();
|
||||
|
||||
@@ -46,14 +46,14 @@ const handler = async (req, res) => {
|
||||
"Content-Type": "application/json",
|
||||
},
|
||||
body: JSON.stringify({
|
||||
type: "post_rating",
|
||||
type: "message_rating",
|
||||
user: {
|
||||
id: token.sub,
|
||||
display_name: token.name || token.email,
|
||||
auth_method: "local",
|
||||
},
|
||||
post_id: id,
|
||||
user_post_id: interaction.id,
|
||||
message_id: id,
|
||||
user_message_id: interaction.id,
|
||||
...content,
|
||||
}),
|
||||
});
|
||||
|
||||
@@ -36,7 +36,7 @@ const AssistantReply = () => {
|
||||
const text = inputRef.current.value.trim();
|
||||
trigger({
|
||||
id: task.id,
|
||||
update_type: "text_reply_to_post",
|
||||
update_type: "text_reply_to_message",
|
||||
content: {
|
||||
text,
|
||||
},
|
||||
|
||||
@@ -45,7 +45,7 @@ const SummarizeStory = () => {
|
||||
const text = inputRef.current.value.trim();
|
||||
trigger({
|
||||
id: task.id,
|
||||
update_type: "text_reply_to_post",
|
||||
update_type: "text_reply_to_message",
|
||||
content: {
|
||||
text,
|
||||
},
|
||||
|
||||
@@ -18,7 +18,7 @@ const UserReply = () => {
|
||||
|
||||
const inputRef = useRef<HTMLTextAreaElement>(null);
|
||||
|
||||
const { isLoading } = useSWRImmutable("/api/new_task/user_reply", fetcher, {
|
||||
const { isLoading } = useSWRImmutable("/api/new_task/prompter_reply", fetcher, {
|
||||
onSuccess: (data) => {
|
||||
console.log(data);
|
||||
setTasks([data]);
|
||||
@@ -36,7 +36,7 @@ const UserReply = () => {
|
||||
const text = inputRef.current.value.trim();
|
||||
trigger({
|
||||
id: task.id,
|
||||
update_type: "text_reply_to_post",
|
||||
update_type: "text_reply_to_message",
|
||||
content: {
|
||||
text,
|
||||
},
|
||||
|
||||
@@ -37,7 +37,7 @@ const RankAssistantReplies = () => {
|
||||
const submitResponse = (task) => {
|
||||
trigger({
|
||||
id: task.id,
|
||||
update_type: "post_ranking",
|
||||
update_type: "message_ranking",
|
||||
content: {
|
||||
ranking,
|
||||
},
|
||||
|
||||
@@ -37,7 +37,7 @@ const RankInitialPrompts = () => {
|
||||
const submitResponse = (task) => {
|
||||
trigger({
|
||||
id: task.id,
|
||||
update_type: "post_ranking",
|
||||
update_type: "message_ranking",
|
||||
content: {
|
||||
ranking,
|
||||
},
|
||||
|
||||
@@ -21,7 +21,7 @@ const RankUserReplies = () => {
|
||||
*/
|
||||
const [ranking, setRanking] = useState<number[]>([]);
|
||||
|
||||
const { isLoading } = useSWRImmutable("/api/new_task/rank_user_replies", fetcher, {
|
||||
const { isLoading } = useSWRImmutable("/api/new_task/rank_prompter_replies", fetcher, {
|
||||
onSuccess: (data) => {
|
||||
setTasks([data]);
|
||||
},
|
||||
@@ -37,7 +37,7 @@ const RankUserReplies = () => {
|
||||
const submitResponse = (task) => {
|
||||
trigger({
|
||||
id: task.id,
|
||||
update_type: "post_ranking",
|
||||
update_type: "message_ranking",
|
||||
content: {
|
||||
ranking,
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user