diff --git a/app/web_ui/src/lib/api_schema.d.ts b/app/web_ui/src/lib/api_schema.d.ts index 4a61a67..6e5e1de 100644 --- a/app/web_ui/src/lib/api_schema.d.ts +++ b/app/web_ui/src/lib/api_schema.d.ts @@ -175,24 +175,25 @@ export interface paths { patch?: never; trace?: never; }; - "/api/projects/{project_id}/tasks/{task_id}/run": { + "/api/projects/{project_id}/tasks/{task_id}/runs/{run_id}": { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; - get?: never; + /** Get Run */ + get: operations["get_run_api_projects__project_id__tasks__task_id__runs__run_id__get"]; put?: never; - /** Run Task */ - post: operations["run_task_api_projects__project_id__tasks__task_id__run_post"]; + post?: never; delete?: never; options?: never; head?: never; - patch?: never; + /** Update Run Route */ + patch: operations["update_run_route_api_projects__project_id__tasks__task_id__runs__run_id__patch"]; trace?: never; }; - "/api/projects/{project_id}/tasks/{task_id}/runs/{run_id}": { + "/api/projects/{project_id}/tasks/{task_id}/run": { parameters: { query?: never; header?: never; @@ -201,12 +202,12 @@ export interface paths { }; get?: never; put?: never; - post?: never; + /** Run Task */ + post: operations["run_task_api_projects__project_id__tasks__task_id__run_post"]; delete?: never; options?: never; head?: never; - /** Update Run Route */ - patch: operations["update_run_route_api_projects__project_id__tasks__task_id__runs__run_id__patch"]; + patch?: never; trace?: never; }; "/api/settings": { @@ -279,7 +280,7 @@ export interface components { */ v: number; /** Id */ - id?: string; + id?: string | null; /** Path */ path?: string | null; /** @@ -308,12 +309,6 @@ export interface components { /** Structured Input */ structured_input?: Record | null; }; - /** RunTaskResponse */ - RunTaskResponse: { - run?: components["schemas"]["TaskRun"] | null; - /** Raw Output */ - raw_output?: string | null; - }; /** * TaskOutput * @description An output for a specific task run. @@ -325,7 +320,7 @@ export interface components { */ v: number; /** Id */ - id?: string; + id?: string | null; /** * Created At * Format: date-time @@ -358,7 +353,7 @@ export interface components { */ v: number; /** Id */ - id?: string; + id?: string | null; /** * Created At * Format: date-time @@ -400,7 +395,7 @@ export interface components { */ v: number; /** Id */ - id?: string; + id?: string | null; /** * Created At * Format: date-time @@ -762,19 +757,53 @@ export interface operations { }; }; }; - run_task_api_projects__project_id__tasks__task_id__run_post: { + get_run_api_projects__project_id__tasks__task_id__runs__run_id__get: { parameters: { query?: never; header?: never; path: { project_id: string; task_id: string; + run_id: string; + }; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description Successful Response */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["TaskRun"]; + }; + }; + /** @description Validation Error */ + 422: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["HTTPValidationError"]; + }; + }; + }; + }; + update_run_route_api_projects__project_id__tasks__task_id__runs__run_id__patch: { + parameters: { + query?: never; + header?: never; + path: { + project_id: string; + task_id: string; + run_id: string; }; cookie?: never; }; requestBody: { content: { - "application/json": components["schemas"]["RunTaskRequest"]; + "application/json": Record; }; }; responses: { @@ -784,7 +813,7 @@ export interface operations { [name: string]: unknown; }; content: { - "application/json": components["schemas"]["RunTaskResponse"]; + "application/json": components["schemas"]["TaskRun"]; }; }; /** @description Validation Error */ @@ -798,20 +827,19 @@ export interface operations { }; }; }; - update_run_route_api_projects__project_id__tasks__task_id__runs__run_id__patch: { + run_task_api_projects__project_id__tasks__task_id__run_post: { parameters: { query?: never; header?: never; path: { project_id: string; task_id: string; - run_id: string; }; cookie?: never; }; requestBody: { content: { - "application/json": Record; + "application/json": components["schemas"]["RunTaskRequest"]; }; }; responses: { diff --git a/app/web_ui/src/routes/(app)/run/+page.svelte b/app/web_ui/src/routes/(app)/run/+page.svelte index 2468c69..ad95bb1 100644 --- a/app/web_ui/src/routes/(app)/run/+page.svelte +++ b/app/web_ui/src/routes/(app)/run/+page.svelte @@ -8,7 +8,6 @@ import Run from "./run.svelte" import createClient from "openapi-fetch" import { type components, type paths } from "$lib/api_schema.d" - import Output from "./output.svelte" // TODO: implement checking input content let warn_before_unload = false @@ -27,45 +26,42 @@ $: provider = model.split("/")[0] // TODO: remove test data - let response: components["schemas"]["RunTaskResponse"] | null = { - run: { + let response: components["schemas"]["TaskRun"] | null = { + v: 1, + id: "123", + input: "asdf", + model_type: "run", + input_source: { + type: "human", + properties: { + a: 1, + b: "asdf", + }, + }, + output: { v: 1, - id: "123", - input: "asdf", - model_type: "run", - input_source: { - type: "human", + output: + '{"setup": "Why did the scarecrow win an award?", "punchline": "Because he was outstanding in his field!"}', + source: { + type: "synthetic", properties: { - a: 1, - b: "asdf", + model_type: "openai/gpt_4o_mini", }, }, - output: { + model_type: "output", + rating: { v: 1, - output: '{"a": 1, "b": "asdf"}', - source: { - type: "synthetic", - properties: { - model_type: "openai/gpt_4o_mini", - }, - }, - model_type: "output", - rating: { - v: 1, - id: "270303291267", - created_at: "2024-10-16T10:24:00.872146", - created_by: "scosman", - type: "five_star", - value: 4, - requirement_ratings: { - "570793306757": 3, - }, - model_type: "task_output_rating", + id: "270303291267", + created_at: "2024-10-16T10:24:00.872146", + created_by: "scosman", + type: "five_star", + value: 4, + requirement_ratings: { + "570793306757": 3, }, + model_type: "task_output_rating", }, }, - raw_output: - '{"setup": "Why did the scarecrow win an award?", "punchline": "Because he was outstanding in his field!"}', } $: subtitle = $current_task ? "Task: " + $current_task.name : "" @@ -187,22 +183,13 @@ {#if $current_task && !submitting && response != null && $current_project} - {#if response.run != null} -
- -
- {:else if response?.raw_output} - -
Run Output
- + - {/if} + {/if}