fix api prompt not added in create version
This commit is contained in:
@@ -45,6 +45,12 @@ export default function CreateVersionDialog({ onClose }: Props) {
|
||||
throw new Error("No workflow selected");
|
||||
}
|
||||
setSubmitting(true);
|
||||
const prompt = await app.graphToPrompt();
|
||||
const graph = app.graph.serialize();
|
||||
if (!graph.extra) {
|
||||
graph.extra = {};
|
||||
}
|
||||
graph.extra.apiPrompt = prompt.output ?? null;
|
||||
const input: ShareWorkflowData = {
|
||||
workflow: {
|
||||
name: workflowsTable?.curWorkflow?.name,
|
||||
@@ -52,7 +58,7 @@ export default function CreateVersionDialog({ onClose }: Props) {
|
||||
},
|
||||
version: {
|
||||
name: trimName,
|
||||
json: JSON.stringify(app.graph.serialize()),
|
||||
json: JSON.stringify(graph),
|
||||
},
|
||||
nodeDefs: getNodeDefs(),
|
||||
privacy: EWorkflowPrivacy.PRIVATE,
|
||||
|
||||
@@ -20,6 +20,12 @@ export async function copySharelink(
|
||||
link,
|
||||
};
|
||||
}
|
||||
const prompt = await app.graphToPrompt();
|
||||
const graph = app.graph.serialize();
|
||||
if (!graph.extra) {
|
||||
graph.extra = {};
|
||||
}
|
||||
graph.extra.apiPrompt = prompt.output ?? null;
|
||||
const input: ShareWorkflowData = {
|
||||
workflow: {
|
||||
name: curWorkflow?.name ?? "Untitled",
|
||||
@@ -27,7 +33,7 @@ export async function copySharelink(
|
||||
},
|
||||
version: {
|
||||
name: "v1",
|
||||
json: JSON.stringify(app.graph.serialize()),
|
||||
json: JSON.stringify(graph),
|
||||
},
|
||||
nodeDefs: getNodeDefs(),
|
||||
privacy: EWorkflowPrivacy.PRIVATE,
|
||||
|
||||
Reference in New Issue
Block a user