Jon/model name massage (#2559)

This commit is contained in:
Shuchang Zheng
2025-05-31 19:34:30 -07:00
committed by GitHub
parent b4d5837196
commit 2167d88c20
11 changed files with 67 additions and 60 deletions

View File

@@ -29,7 +29,7 @@ export const navigationNodeDefaultData: NavigationNodeData = {
completeCriterion: "",
terminateCriterion: "",
errorCodeMapping: "null",
model: { model: "" },
model: { model_name: "" },
engine: RunEngine.SkyvernV1,
maxRetries: null,
maxStepsOverride: null,

View File

@@ -19,6 +19,7 @@ import { Switch } from "@/components/ui/switch";
import { Separator } from "@/components/ui/separator";
import { ModelsResponse } from "@/api/types";
import { ModelSelector } from "@/components/ModelSelector";
import { WorkflowModel } from "@/routes/workflows/types/workflowTypes";
function StartNode({ id, data }: NodeProps<StartNode>) {
const credentialGetter = useCredentialGetter();
@@ -33,7 +34,11 @@ function StartNode({ id, data }: NodeProps<StartNode>) {
},
});
const models = availableModels?.models ?? [];
const modelNames = availableModels?.models ?? {};
const firstKey = Object.keys(modelNames)[0];
const workflowModel: WorkflowModel | null = firstKey
? { model_name: modelNames[firstKey] || "" }
: null;
const [inputs, setInputs] = useState({
webhookCallbackUrl: data.withWorkflowSettings
@@ -45,7 +50,7 @@ function StartNode({ id, data }: NodeProps<StartNode>) {
persistBrowserSession: data.withWorkflowSettings
? data.persistBrowserSession
: false,
model: data.withWorkflowSettings ? data.model : { model: models[0] || "" },
model: data.withWorkflowSettings ? data.model : workflowModel,
});
function handleChange(key: string, value: unknown) {

View File

@@ -466,7 +466,7 @@ export type WorkflowSettings = {
model: WorkflowModel | null;
};
export type WorkflowModel = JsonObjectExtendable<{ model: string }>;
export type WorkflowModel = JsonObjectExtendable<{ model_name: string }>;
export function isOutputParameter(
parameter: Parameter,