handle case where we don't get title suggested from LLM (#726)

This commit is contained in:
Kerem Yilmaz
2024-08-25 18:59:42 +03:00
committed by GitHub
parent 815a6fde67
commit 4c33c48c91

View File

@@ -67,7 +67,7 @@ function createTemplateTaskFromTaskGenerationParameters(
values: TaskGenerationApiResponse, values: TaskGenerationApiResponse,
) { ) {
return { return {
title: values.suggested_title ?? "Untitled", title: values.suggested_title ?? "Untitled Task",
description: "", description: "",
is_saved_task: true, is_saved_task: true,
webhook_callback_url: null, webhook_callback_url: null,
@@ -84,7 +84,7 @@ function createTemplateTaskFromTaskGenerationParameters(
blocks: [ blocks: [
{ {
block_type: "task", block_type: "task",
label: values.suggested_title, label: values.suggested_title ?? "Untitled Task",
url: values.url, url: values.url,
navigation_goal: values.navigation_goal, navigation_goal: values.navigation_goal,
data_extraction_goal: values.data_extraction_goal, data_extraction_goal: values.data_extraction_goal,
@@ -153,7 +153,7 @@ function TaskTemplates() {
onError: (error: AxiosError) => { onError: (error: AxiosError) => {
toast({ toast({
variant: "destructive", variant: "destructive",
title: "Error creating task from prompt", title: "Error saving task",
description: error.message, description: error.message,
}); });
}, },
@@ -174,7 +174,7 @@ function TaskTemplates() {
onError: (error: AxiosError) => { onError: (error: AxiosError) => {
toast({ toast({
variant: "destructive", variant: "destructive",
title: "Error creating task from prompt", title: "Error running task",
description: error.message, description: error.message,
}); });
}, },