Skip to content

Commit

Permalink
Save agent prompt to workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
Sensational-Code committed Dec 16, 2024
1 parent e5ec132 commit 2478d2d
Showing 1 changed file with 27 additions and 19 deletions.
46 changes: 27 additions & 19 deletions src/ui/ManagementPortal/pages/agents/create.vue
Original file line number Diff line number Diff line change
Expand Up @@ -1145,10 +1145,12 @@ export default {
this.workflowMainAIModel = null;
}
if (!this.selectedWorkflow?.type) {
this.showWorkflowConfiguration = false;
this.selectedWorkflow = null;
}
this.showWorkflowConfiguration = true;
// if (!this.selectedWorkflow?.type) {
// this.showWorkflowConfiguration = false;
// this.selectedWorkflow = null;
// }
},
workflowMainAIModel() {
Expand Down Expand Up @@ -1196,10 +1198,10 @@ export default {
this.loadingStatusText = 'Retrieving workflows...';
this.workflowOptions = [
{
type: null,
workflow_name: 'None',
},
// {
// type: null,
// workflow_name: 'None',
// },
{
type: 'langgraph-react-agent-workflow',
workflow_name: 'LangGraph ReAct Agent Workflow',
Expand Down Expand Up @@ -1486,10 +1488,6 @@ export default {
this.text_embedding_profile_object_id = this.selectedTextEmbeddingProfile?.object_id ?? '';
}
if (this.systemPrompt === '') {
errors.push('Please provide a system prompt.');
}
if (!this.orchestration_settings.orchestrator) {
errors.push('Please select an orchestrator.');
}
Expand All @@ -1498,10 +1496,18 @@ export default {
errors.push('Please select an AI model for the orchestrator.');
}
if (this.selectedWorkflow && !this.workflowMainAIModel) {
if (!this.selectedWorkflow) {
errors.push('Please select a workflow.');
}
if (!this.workflowMainAIModel) {
errors.push('Please select an AI model for the workflow.');
}
if (this.systemPrompt === '') {
errors.push('Please provide a system prompt.');
}
// if (!this.selectedDataSource) {
// errors.push('Please select a data source.');
// }
Expand Down Expand Up @@ -1616,12 +1622,14 @@ export default {
},
},
// [promptObjectId]: {
// object_id: promptObjectId,
// properties: {
// object_role: 'main_prompt',
// },
// },
...(promptObjectId ? {
[promptObjectId]: {
object_id: promptObjectId,
properties: {
object_role: 'main_prompt',
},
},
} : {}),
},
};
}
Expand Down

0 comments on commit 2478d2d

Please sign in to comment.