feat: update ppt prompt (#7446)

This commit is contained in:
darkskygit
2024-07-08 08:11:30 +00:00
parent bf6c9a5955
commit 556956ced2
6 changed files with 28 additions and 66 deletions

View File

@@ -159,6 +159,7 @@ export class PromptService {
name: true,
action: true,
model: true,
config: true,
messages: {
select: {
role: true,
@@ -222,7 +223,7 @@ export class PromptService {
name: string,
model: string,
messages: PromptMessage[],
config?: PromptConfig
config?: PromptConfig | null
) {
return await this.db.aiPrompt
.create({

View File

@@ -1,6 +1,6 @@
import { NodeExecutorType } from './executor';
import type { WorkflowGraphs } from './types';
import { WorkflowNodeState, WorkflowNodeType } from './types';
import { WorkflowNodeType } from './types';
export const WorkflowGraphList: WorkflowGraphs = [
{
@@ -21,43 +21,6 @@ export const WorkflowGraphList: WorkflowGraphs = [
nodeType: WorkflowNodeType.Basic,
type: NodeExecutorType.ChatText,
promptName: 'workflow:presentation:step2',
edges: ['step3'],
},
{
id: 'step3',
name: 'Step 3: format presentation if needed',
nodeType: WorkflowNodeType.Decision,
condition: (nodeIds: string[], params: WorkflowNodeState) => {
const lines = params.content?.split('\n') || [];
return nodeIds[
Number(
!lines.some(line => {
try {
if (line.trim()) {
JSON.parse(line);
}
return false;
} catch {
return true;
}
})
)
];
},
edges: ['step4', 'step5'],
},
{
id: 'step4',
name: 'Step 4: format presentation',
nodeType: WorkflowNodeType.Basic,
type: NodeExecutorType.ChatText,
promptName: 'workflow:presentation:step4',
edges: ['step5'],
},
{
id: 'step5',
name: 'Step 5: finish',
nodeType: WorkflowNodeType.Nope,
edges: [],
},
],