ad-agent_architecture 0.0.22 → 0.0.23
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.builders/generators/project-plan.rb +9 -1
- data/.rubocop.yml +6 -0
- data/CHANGELOG.md +7 -0
- data/a1.json +1 -0
- data/a2.json +463 -0
- data/docs/project-plan/project.drawio +38 -23
- data/docs/project-plan/project_done.svg +1 -1
- data/docs/project-plan/project_in_progress.svg +1 -1
- data/docs/project-plan/project_todo.svg +1 -1
- data/docs/requirements.md +6 -0
- data/lib/ad/agent_architecture/database/create_schema.rb +13 -3
- data/lib/ad/agent_architecture/database/models.rb +7 -0
- data/lib/ad/agent_architecture/dsl/actions/save_database.rb +48 -11
- data/lib/ad/agent_architecture/dsl/actions/save_json.rb +3 -4
- data/lib/ad/agent_architecture/dsl/agent_dsl.rb +19 -9
- data/lib/ad/agent_architecture/dsl/attribute_dsl.rb +28 -2
- data/lib/ad/agent_architecture/dsl/data_accessors.rb +7 -2
- data/lib/ad/agent_architecture/dsl/prompt_dsl.rb +24 -4
- data/lib/ad/agent_architecture/dsl/section_dsl.rb +12 -4
- data/lib/ad/agent_architecture/dsl/settings_dsl.rb +2 -2
- data/lib/ad/agent_architecture/dsl/step_dsl.rb +8 -3
- data/lib/ad/agent_architecture/dsl/workflow_dsl.rb +9 -4
- data/lib/ad/agent_architecture/report/agent_data_builder.rb +132 -0
- data/lib/ad/agent_architecture/version.rb +1 -1
- data/lib/ad/agent_architecture.rb +2 -0
- data/package-lock.json +2 -2
- data/package.json +1 -1
- metadata +19 -2
@@ -1,3 +1,3 @@
|
|
1
1
|
<?xml version="1.0" encoding="UTF-8"?>
|
2
2
|
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
3
|
-
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" width="942px" height="142px" viewBox="-0.5 -0.5 942 142"><defs><linearGradient x1="0%" y1="0%" x2="0%" y2="100%" id="mx-gradient-ffffff-0.9-ffffff-0.1-s-0"><stop offset="0%" style="stop-color: rgb(255, 255, 255); stop-opacity: 0.9;"/><stop offset="100%" style="stop-color: rgb(255, 255, 255); stop-opacity: 0.1;"/></linearGradient></defs><g><g data-cell-id="
|
3
|
+
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" width="942px" height="142px" viewBox="-0.5 -0.5 942 142"><defs><linearGradient x1="0%" y1="0%" x2="0%" y2="100%" id="mx-gradient-ffffff-0.9-ffffff-0.1-s-0"><stop offset="0%" style="stop-color: rgb(255, 255, 255); stop-opacity: 0.9;"/><stop offset="100%" style="stop-color: rgb(255, 255, 255); stop-opacity: 0.1;"/></linearGradient></defs><g><g data-cell-id="page_root_G2r"><g data-cell-id="node_root_G2r"><g data-cell-id="G2r-2"><g><rect x="0" y="0" width="300" height="60" rx="9" ry="9" fill="#f8cecc" stroke="#b85450" pointer-events="all"/><path d="M 10.15 -1 Q -1 -1 -1 10.15 L -1 24 Q 150 42 301 24 L 301 10.15 Q 301 -1 289.85 -1 Z" fill="url(#mx-gradient-ffffff-0.9-ffffff-0.1-s-0)" stroke="none" pointer-events="all"/></g><g><g transform="translate(-0.5 -0.5)"><switch><foreignObject pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility" style="overflow: visible; text-align: left;"><div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe center; width: 298px; height: 1px; padding-top: 30px; margin-left: 1px;"><div data-drawio-colors="color: #333333; " style="box-sizing: border-box; font-size: 0px; text-align: center;"><div style="display: inline-block; font-size: 12px; font-family: Helvetica; color: rgb(51, 51, 51); line-height: 1.2; pointer-events: all; white-space: normal; overflow-wrap: normal;">Generate DSL for an Agent Architecture workflow</div></div></div></foreignObject><text x="150" y="34" fill="#333333" font-family=""Helvetica"" font-size="12px" text-anchor="middle">Generate DSL for an Agent Architecture workflow</text></switch></g></g></g><g data-cell-id="G2r-3"><g><rect x="320" y="0" width="300" height="60" rx="9" ry="9" fill="#f8cecc" stroke="#b85450" pointer-events="all"/><path d="M 330.15 -1 Q 319 -1 319 10.15 L 319 24 Q 470 42 621 24 L 621 10.15 Q 621 -1 609.85 -1 Z" fill="url(#mx-gradient-ffffff-0.9-ffffff-0.1-s-0)" stroke="none" pointer-events="all"/></g><g><g transform="translate(-0.5 -0.5)"><switch><foreignObject pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility" style="overflow: visible; text-align: left;"><div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe center; width: 298px; height: 1px; padding-top: 30px; margin-left: 321px;"><div data-drawio-colors="color: #333333; " style="box-sizing: border-box; font-size: 0px; text-align: center;"><div style="display: inline-block; font-size: 12px; font-family: Helvetica; color: rgb(51, 51, 51); line-height: 1.2; pointer-events: all; white-space: normal; overflow-wrap: normal;">Attributes are auto created when used in a step, but not preconfigured</div></div></div></foreignObject><text x="470" y="34" fill="#333333" font-family=""Helvetica"" font-size="12px" text-anchor="middle">Attributes are auto created when used in a step, b...</text></switch></g></g></g><g data-cell-id="G2r-4"><g><rect x="640" y="0" width="300" height="60" rx="9" ry="9" fill="#f8cecc" stroke="#b85450" pointer-events="all"/><path d="M 650.15 -1 Q 639 -1 639 10.15 L 639 24 Q 790 42 941 24 L 941 10.15 Q 941 -1 929.85 -1 Z" fill="url(#mx-gradient-ffffff-0.9-ffffff-0.1-s-0)" stroke="none" pointer-events="all"/></g><g><g transform="translate(-0.5 -0.5)"><switch><foreignObject pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility" style="overflow: visible; text-align: left;"><div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe center; width: 298px; height: 1px; padding-top: 30px; margin-left: 641px;"><div data-drawio-colors="color: #333333; " style="box-sizing: border-box; font-size: 0px; text-align: center;"><div style="display: inline-block; font-size: 12px; font-family: Helvetica; color: rgb(51, 51, 51); line-height: 1.2; pointer-events: all; white-space: normal; overflow-wrap: normal;">Add support for project plan</div></div></div></foreignObject><text x="790" y="34" fill="#333333" font-family=""Helvetica"" font-size="12px" text-anchor="middle">Add support for project plan</text></switch></g></g></g><g data-cell-id="G2r-5"><g><rect x="0" y="80" width="300" height="60" rx="9" ry="9" fill="#f8cecc" stroke="#b85450" pointer-events="all"/><path d="M 10.15 79 Q -1 79 -1 90.15 L -1 104 Q 150 122 301 104 L 301 90.15 Q 301 79 289.85 79 Z" fill="url(#mx-gradient-ffffff-0.9-ffffff-0.1-s-0)" stroke="none" pointer-events="all"/></g><g><g transform="translate(-0.5 -0.5)"><switch><foreignObject pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility" style="overflow: visible; text-align: left;"><div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe center; width: 298px; height: 1px; padding-top: 110px; margin-left: 1px;"><div data-drawio-colors="color: #333333; " style="box-sizing: border-box; font-size: 0px; text-align: center;"><div style="display: inline-block; font-size: 12px; font-family: Helvetica; color: rgb(51, 51, 51); line-height: 1.2; pointer-events: all; white-space: normal; overflow-wrap: normal;">Fix the DB issue introduced via DSL refactor</div></div></div></foreignObject><text x="150" y="114" fill="#333333" font-family=""Helvetica"" font-size="12px" text-anchor="middle">Fix the DB issue introduced via DSL refactor</text></switch></g></g></g></g></g></g><switch><g requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility"/><a transform="translate(0,-5)" xlink:href="https://www.drawio.com/doc/faq/svg-export-text-problems" target="_blank"><text text-anchor="middle" font-size="10px" x="50%" y="100%">Text is not SVG - cannot display</text></a></switch></svg>
|
@@ -1,3 +1,3 @@
|
|
1
1
|
<?xml version="1.0" encoding="UTF-8"?>
|
2
2
|
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
3
|
-
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" width="
|
3
|
+
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" width="942px" height="142px" viewBox="-0.5 -0.5 942 142"><defs><linearGradient x1="0%" y1="0%" x2="0%" y2="100%" id="mx-gradient-ffffff-0.9-ffffff-0.1-s-0"><stop offset="0%" style="stop-color: rgb(255, 255, 255); stop-opacity: 0.9;"/><stop offset="100%" style="stop-color: rgb(255, 255, 255); stop-opacity: 0.1;"/></linearGradient></defs><g><g data-cell-id="page_root_yIc"><g data-cell-id="node_root_yIc"><g data-cell-id="yIc-2"><g><rect x="0" y="0" width="300" height="60" rx="9" ry="9" fill="#d5e8d4" stroke="#82b366" pointer-events="all"/><path d="M 10.15 -1 Q -1 -1 -1 10.15 L -1 24 Q 150 42 301 24 L 301 10.15 Q 301 -1 289.85 -1 Z" fill="url(#mx-gradient-ffffff-0.9-ffffff-0.1-s-0)" stroke="none" pointer-events="all"/></g><g><g transform="translate(-0.5 -0.5)"><switch><foreignObject pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility" style="overflow: visible; text-align: left;"><div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe center; width: 298px; height: 1px; padding-top: 30px; margin-left: 1px;"><div data-drawio-colors="color: #333333; " style="box-sizing: border-box; font-size: 0px; text-align: center;"><div style="display: inline-block; font-size: 12px; font-family: Helvetica; color: rgb(51, 51, 51); line-height: 1.2; pointer-events: all; white-space: normal; overflow-wrap: normal;">Add saved workflow ID and save? to the DSL</div></div></div></foreignObject><text x="150" y="34" fill="#333333" font-family=""Helvetica"" font-size="12px" text-anchor="middle">Add saved workflow ID and save? to the DSL</text></switch></g></g></g><g data-cell-id="yIc-3"><g><rect x="320" y="0" width="300" height="60" rx="9" ry="9" fill="#d5e8d4" stroke="#82b366" pointer-events="all"/><path d="M 330.15 -1 Q 319 -1 319 10.15 L 319 24 Q 470 42 621 24 L 621 10.15 Q 621 -1 609.85 -1 Z" fill="url(#mx-gradient-ffffff-0.9-ffffff-0.1-s-0)" stroke="none" pointer-events="all"/></g><g><g transform="translate(-0.5 -0.5)"><switch><foreignObject pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility" style="overflow: visible; text-align: left;"><div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe center; width: 298px; height: 1px; padding-top: 30px; margin-left: 321px;"><div data-drawio-colors="color: #333333; " style="box-sizing: border-box; font-size: 0px; text-align: center;"><div style="display: inline-block; font-size: 12px; font-family: Helvetica; color: rgb(51, 51, 51); line-height: 1.2; pointer-events: all; white-space: normal; overflow-wrap: normal;">Prompt set in step DSL will now lookup common prompts</div></div></div></foreignObject><text x="470" y="34" fill="#333333" font-family=""Helvetica"" font-size="12px" text-anchor="middle">Prompt set in step DSL will now lookup common prom...</text></switch></g></g></g><g data-cell-id="yIc-4"><g><rect x="640" y="0" width="300" height="60" rx="9" ry="9" fill="#d5e8d4" stroke="#82b366" pointer-events="all"/><path d="M 650.15 -1 Q 639 -1 639 10.15 L 639 24 Q 790 42 941 24 L 941 10.15 Q 941 -1 929.85 -1 Z" fill="url(#mx-gradient-ffffff-0.9-ffffff-0.1-s-0)" stroke="none" pointer-events="all"/></g><g><g transform="translate(-0.5 -0.5)"><switch><foreignObject pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility" style="overflow: visible; text-align: left;"><div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe center; width: 298px; height: 1px; padding-top: 30px; margin-left: 641px;"><div data-drawio-colors="color: #333333; " style="box-sizing: border-box; font-size: 0px; text-align: center;"><div style="display: inline-block; font-size: 12px; font-family: Helvetica; color: rgb(51, 51, 51); line-height: 1.2; pointer-events: all; white-space: normal; overflow-wrap: normal;">Create tests for Agent Data Builder and hook up to save YAML/JSON</div></div></div></foreignObject><text x="790" y="34" fill="#333333" font-family=""Helvetica"" font-size="12px" text-anchor="middle">Create tests for Agent Data Builder and hook up to...</text></switch></g></g></g><g data-cell-id="yIc-5"><g><rect x="0" y="80" width="300" height="60" rx="9" ry="9" fill="#d5e8d4" stroke="#82b366" pointer-events="all"/><path d="M 10.15 79 Q -1 79 -1 90.15 L -1 104 Q 150 122 301 104 L 301 90.15 Q 301 79 289.85 79 Z" fill="url(#mx-gradient-ffffff-0.9-ffffff-0.1-s-0)" stroke="none" pointer-events="all"/></g><g><g transform="translate(-0.5 -0.5)"><switch><foreignObject pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility" style="overflow: visible; text-align: left;"><div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe center; width: 298px; height: 1px; padding-top: 110px; margin-left: 1px;"><div data-drawio-colors="color: #333333; " style="box-sizing: border-box; font-size: 0px; text-align: center;"><div style="display: inline-block; font-size: 12px; font-family: Helvetica; color: rgb(51, 51, 51); line-height: 1.2; pointer-events: all; white-space: normal; overflow-wrap: normal;">Settings need to persist in the settings or workflow table</div></div></div></foreignObject><text x="150" y="114" fill="#333333" font-family=""Helvetica"" font-size="12px" text-anchor="middle">Settings need to persist in the settings or workfl...</text></switch></g></g></g><g data-cell-id="yIc-6"><g><rect x="320" y="80" width="300" height="60" rx="9" ry="9" fill="#d5e8d4" stroke="#82b366" pointer-events="all"/><path d="M 330.15 79 Q 319 79 319 90.15 L 319 104 Q 470 122 621 104 L 621 90.15 Q 621 79 609.85 79 Z" fill="url(#mx-gradient-ffffff-0.9-ffffff-0.1-s-0)" stroke="none" pointer-events="all"/></g><g><g transform="translate(-0.5 -0.5)"><switch><foreignObject pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility" style="overflow: visible; text-align: left;"><div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe center; width: 298px; height: 1px; padding-top: 110px; margin-left: 321px;"><div data-drawio-colors="color: #333333; " style="box-sizing: border-box; font-size: 0px; text-align: center;"><div style="display: inline-block; font-size: 12px; font-family: Helvetica; color: rgb(51, 51, 51); line-height: 1.2; pointer-events: all; white-space: normal; overflow-wrap: normal;">Add add title name & description support to Agent Data Builder</div></div></div></foreignObject><text x="470" y="114" fill="#333333" font-family=""Helvetica"" font-size="12px" text-anchor="middle">Add add title name & description support to Agent...</text></switch></g></g></g><g data-cell-id="yIc-7"><g><rect x="640" y="80" width="300" height="60" rx="9" ry="9" fill="#d5e8d4" stroke="#82b366" pointer-events="all"/><path d="M 650.15 79 Q 639 79 639 90.15 L 639 104 Q 790 122 941 104 L 941 90.15 Q 941 79 929.85 79 Z" fill="url(#mx-gradient-ffffff-0.9-ffffff-0.1-s-0)" stroke="none" pointer-events="all"/></g><g><g transform="translate(-0.5 -0.5)"><switch><foreignObject pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility" style="overflow: visible; text-align: left;"><div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe center; width: 298px; height: 1px; padding-top: 110px; margin-left: 641px;"><div data-drawio-colors="color: #333333; " style="box-sizing: border-box; font-size: 0px; text-align: center;"><div style="display: inline-block; font-size: 12px; font-family: Helvetica; color: rgb(51, 51, 51); line-height: 1.2; pointer-events: all; white-space: normal; overflow-wrap: normal;">Add fluent method access to all DSLs</div></div></div></foreignObject><text x="790" y="114" fill="#333333" font-family=""Helvetica"" font-size="12px" text-anchor="middle">Add fluent method access to all DSLs</text></switch></g></g></g></g></g></g><switch><g requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility"/><a transform="translate(0,-5)" xlink:href="https://www.drawio.com/doc/faq/svg-export-text-problems" target="_blank"><text text-anchor="middle" font-size="10px" x="50%" y="100%">Text is not SVG - cannot display</text></a></switch></svg>
|
@@ -1,3 +1,3 @@
|
|
1
1
|
<?xml version="1.0" encoding="UTF-8"?>
|
2
2
|
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
3
|
-
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" width="942px" height="222px" viewBox="-0.5 -0.5 942 222"><defs><linearGradient x1="0%" y1="0%" x2="0%" y2="100%" id="mx-gradient-ffffff-0.9-ffffff-0.1-s-0"><stop offset="0%" style="stop-color: rgb(255, 255, 255); stop-opacity: 0.9;"/><stop offset="100%" style="stop-color: rgb(255, 255, 255); stop-opacity: 0.1;"/></linearGradient></defs><g><g data-cell-id="page_root_pnQ"><g data-cell-id="node_root_pnQ"><g data-cell-id="pnQ-2"><g><rect x="0" y="0" width="300" height="60" rx="9" ry="9" fill="#dae8fc" stroke="#6c8ebf" pointer-events="all"/><path d="M 10.15 -1 Q -1 -1 -1 10.15 L -1 24 Q 150 42 301 24 L 301 10.15 Q 301 -1 289.85 -1 Z" fill="url(#mx-gradient-ffffff-0.9-ffffff-0.1-s-0)" stroke="none" pointer-events="all"/></g><g><g transform="translate(-0.5 -0.5)"><switch><foreignObject pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility" style="overflow: visible; text-align: left;"><div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe center; width: 298px; height: 1px; padding-top: 30px; margin-left: 1px;"><div data-drawio-colors="color: #333333; " style="box-sizing: border-box; font-size: 0px; text-align: center;"><div style="display: inline-block; font-size: 12px; font-family: Helvetica; color: rgb(51, 51, 51); line-height: 1.2; pointer-events: all; white-space: normal; overflow-wrap: normal;">Visual graph of the workflow</div></div></div></foreignObject><text x="150" y="34" fill="#333333" font-family=""Helvetica"" font-size="12px" text-anchor="middle">Visual graph of the workflow</text></switch></g></g></g><g data-cell-id="pnQ-3"><g><rect x="320" y="0" width="300" height="60" rx="9" ry="9" fill="#dae8fc" stroke="#6c8ebf" pointer-events="all"/><path d="M 330.15 -1 Q 319 -1 319 10.15 L 319 24 Q 470 42 621 24 L 621 10.15 Q 621 -1 609.85 -1 Z" fill="url(#mx-gradient-ffffff-0.9-ffffff-0.1-s-0)" stroke="none" pointer-events="all"/></g><g><g transform="translate(-0.5 -0.5)"><switch><foreignObject pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility" style="overflow: visible; text-align: left;"><div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe center; width: 298px; height: 1px; padding-top: 30px; margin-left: 321px;"><div data-drawio-colors="color: #333333; " style="box-sizing: border-box; font-size: 0px; text-align: center;"><div style="display: inline-block; font-size: 12px; font-family: Helvetica; color: rgb(51, 51, 51); line-height: 1.2; pointer-events: all; white-space: normal; overflow-wrap: normal;">Horizontal</div></div></div></foreignObject><text x="470" y="34" fill="#333333" font-family=""Helvetica"" font-size="12px" text-anchor="middle">Horizontal</text></switch></g></g></g><g data-cell-id="pnQ-4"><g><rect x="640" y="0" width="300" height="60" rx="9" ry="9" fill="#dae8fc" stroke="#6c8ebf" pointer-events="all"/><path d="M 650.15 -1 Q 639 -1 639 10.15 L 639 24 Q 790 42 941 24 L 941 10.15 Q 941 -1 929.85 -1 Z" fill="url(#mx-gradient-ffffff-0.9-ffffff-0.1-s-0)" stroke="none" pointer-events="all"/></g><g><g transform="translate(-0.5 -0.5)"><switch><foreignObject pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility" style="overflow: visible; text-align: left;"><div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe center; width: 298px; height: 1px; padding-top: 30px; margin-left: 641px;"><div data-drawio-colors="color: #333333; " style="box-sizing: border-box; font-size: 0px; text-align: center;"><div style="display: inline-block; font-size: 12px; font-family: Helvetica; color: rgb(51, 51, 51); line-height: 1.2; pointer-events: all; white-space: normal; overflow-wrap: normal;">Clicking on sections will show the steps in that section</div></div></div></foreignObject><text x="790" y="34" fill="#333333" font-family=""Helvetica"" font-size="12px" text-anchor="middle">Clicking on sections will show the steps in that s...</text></switch></g></g></g><g data-cell-id="pnQ-5"><g><rect x="0" y="80" width="300" height="60" rx="9" ry="9" fill="#dae8fc" stroke="#6c8ebf" pointer-events="all"/><path d="M 10.15 79 Q -1 79 -1 90.15 L -1 104 Q 150 122 301 104 L 301 90.15 Q 301 79 289.85 79 Z" fill="url(#mx-gradient-ffffff-0.9-ffffff-0.1-s-0)" stroke="none" pointer-events="all"/></g><g><g transform="translate(-0.5 -0.5)"><switch><foreignObject pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility" style="overflow: visible; text-align: left;"><div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe center; width: 298px; height: 1px; padding-top: 110px; margin-left: 1px;"><div data-drawio-colors="color: #333333; " style="box-sizing: border-box; font-size: 0px; text-align: center;"><div style="display: inline-block; font-size: 12px; font-family: Helvetica; color: rgb(51, 51, 51); line-height: 1.2; pointer-events: all; white-space: normal; overflow-wrap: normal;">Clicking on attributes will show all attributes in the workflow</div></div></div></foreignObject><text x="150" y="114" fill="#333333" font-family=""Helvetica"" font-size="12px" text-anchor="middle">Clicking on attributes will show all attributes in...</text></switch></g></g></g><g data-cell-id="pnQ-6"><g><rect x="320" y="80" width="300" height="60" rx="9" ry="9" fill="#dae8fc" stroke="#6c8ebf" pointer-events="all"/><path d="M 330.15 79 Q 319 79 319 90.15 L 319 104 Q 470 122 621 104 L 621 90.15 Q 621 79 609.85 79 Z" fill="url(#mx-gradient-ffffff-0.9-ffffff-0.1-s-0)" stroke="none" pointer-events="all"/></g><g><g transform="translate(-0.5 -0.5)"><switch><foreignObject pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility" style="overflow: visible; text-align: left;"><div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe center; width: 298px; height: 1px; padding-top: 110px; margin-left: 321px;"><div data-drawio-colors="color: #333333; " style="box-sizing: border-box; font-size: 0px; text-align: center;"><div style="display: inline-block; font-size: 12px; font-family: Helvetica; color: rgb(51, 51, 51); line-height: 1.2; pointer-events: all; white-space: normal; overflow-wrap: normal;">Clicking on prompts will show all prompts in the workflow</div></div></div></foreignObject><text x="470" y="114" fill="#333333" font-family=""Helvetica"" font-size="12px" text-anchor="middle">Clicking on prompts will show all prompts in the w...</text></switch></g></g></g><g data-cell-id="pnQ-7"><g><rect x="640" y="80" width="300" height="60" rx="9" ry="9" fill="#dae8fc" stroke="#6c8ebf" pointer-events="all"/><path d="M 650.15 79 Q 639 79 639 90.15 L 639 104 Q 790 122 941 104 L 941 90.15 Q 941 79 929.85 79 Z" fill="url(#mx-gradient-ffffff-0.9-ffffff-0.1-s-0)" stroke="none" pointer-events="all"/></g><g><g transform="translate(-0.5 -0.5)"><switch><foreignObject pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility" style="overflow: visible; text-align: left;"><div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe center; width: 298px; height: 1px; padding-top: 110px; margin-left: 641px;"><div data-drawio-colors="color: #333333; " style="box-sizing: border-box; font-size: 0px; text-align: center;"><div style="display: inline-block; font-size: 12px; font-family: Helvetica; color: rgb(51, 51, 51); line-height: 1.2; pointer-events: all; white-space: normal; overflow-wrap: normal;">Clicking on dashboard will show visual hierarchy of the workflow</div></div></div></foreignObject><text x="790" y="114" fill="#333333" font-family=""Helvetica"" font-size="12px" text-anchor="middle">Clicking on dashboard will show visual hierarchy o...</text></switch></g></g></g><g data-cell-id="pnQ-8"><g><rect x="0" y="160" width="300" height="60" rx="9" ry="9" fill="#dae8fc" stroke="#6c8ebf" pointer-events="all"/><path d="M 10.15 159 Q -1 159 -1 170.15 L -1 184 Q 150 202 301 184 L 301 170.15 Q 301 159 289.85 159 Z" fill="url(#mx-gradient-ffffff-0.9-ffffff-0.1-s-0)" stroke="none" pointer-events="all"/></g><g><g transform="translate(-0.5 -0.5)"><switch><foreignObject pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility" style="overflow: visible; text-align: left;"><div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe center; width: 298px; height: 1px; padding-top: 190px; margin-left: 1px;"><div data-drawio-colors="color: #333333; " style="box-sizing: border-box; font-size: 0px; text-align: center;"><div style="display: inline-block; font-size: 12px; font-family: Helvetica; color: rgb(51, 51, 51); line-height: 1.2; pointer-events: all; white-space: normal; overflow-wrap: normal;">Need a runs button</div></div></div></foreignObject><text x="150" y="194" fill="#333333" font-family=""Helvetica"" font-size="12px" text-anchor="middle">Need a runs button</text></switch></g></g></g><g data-cell-id="pnQ-9"><g><rect x="320" y="160" width="300" height="60" rx="9" ry="9" fill="#dae8fc" stroke="#6c8ebf" pointer-events="all"/><path d="M 330.15 159 Q 319 159 319 170.15 L 319 184 Q 470 202 621 184 L 621 170.15 Q 621 159 609.85 159 Z" fill="url(#mx-gradient-ffffff-0.9-ffffff-0.1-s-0)" stroke="none" pointer-events="all"/></g><g><g transform="translate(-0.5 -0.5)"><switch><foreignObject pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility" style="overflow: visible; text-align: left;"><div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe center; width: 298px; height: 1px; padding-top: 190px; margin-left: 321px;"><div data-drawio-colors="color: #333333; " style="box-sizing: border-box; font-size: 0px; text-align: center;"><div style="display: inline-block; font-size: 12px; font-family: Helvetica; color: rgb(51, 51, 51); line-height: 1.2; pointer-events: all; white-space: normal; overflow-wrap: normal;">VCode Editor: https://chatgpt.com/c/e09e1367-db5e-4786-b362-db35805b1e20</div></div></div></foreignObject><text x="470" y="194" fill="#333333" font-family=""Helvetica"" font-size="12px" text-anchor="middle">VCode Editor: https://chatgpt.com/c/e09e1367-db5e-...</text></switch></g></g></g></g></g></g><switch><g requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility"/><a transform="translate(0,-5)" xlink:href="https://www.drawio.com/doc/faq/svg-export-text-problems" target="_blank"><text text-anchor="middle" font-size="10px" x="50%" y="100%">Text is not SVG - cannot display</text></a></switch></svg>
|
3
|
+
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" width="942px" height="222px" viewBox="-0.5 -0.5 942 222"><defs><linearGradient x1="0%" y1="0%" x2="0%" y2="100%" id="mx-gradient-ffffff-0.9-ffffff-0.1-s-0"><stop offset="0%" style="stop-color: rgb(255, 255, 255); stop-opacity: 0.9;"/><stop offset="100%" style="stop-color: rgb(255, 255, 255); stop-opacity: 0.1;"/></linearGradient></defs><g><g data-cell-id="page_root_QAD"><g data-cell-id="node_root_QAD"><g data-cell-id="QAD-2"><g><rect x="0" y="0" width="300" height="60" rx="9" ry="9" fill="#dae8fc" stroke="#6c8ebf" pointer-events="all"/><path d="M 10.15 -1 Q -1 -1 -1 10.15 L -1 24 Q 150 42 301 24 L 301 10.15 Q 301 -1 289.85 -1 Z" fill="url(#mx-gradient-ffffff-0.9-ffffff-0.1-s-0)" stroke="none" pointer-events="all"/></g><g><g transform="translate(-0.5 -0.5)"><switch><foreignObject pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility" style="overflow: visible; text-align: left;"><div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe center; width: 298px; height: 1px; padding-top: 30px; margin-left: 1px;"><div data-drawio-colors="color: #333333; " style="box-sizing: border-box; font-size: 0px; text-align: center;"><div style="display: inline-block; font-size: 12px; font-family: Helvetica; color: rgb(51, 51, 51); line-height: 1.2; pointer-events: all; white-space: normal; overflow-wrap: normal;">Visual graph of the workflow</div></div></div></foreignObject><text x="150" y="34" fill="#333333" font-family=""Helvetica"" font-size="12px" text-anchor="middle">Visual graph of the workflow</text></switch></g></g></g><g data-cell-id="QAD-3"><g><rect x="320" y="0" width="300" height="60" rx="9" ry="9" fill="#dae8fc" stroke="#6c8ebf" pointer-events="all"/><path d="M 330.15 -1 Q 319 -1 319 10.15 L 319 24 Q 470 42 621 24 L 621 10.15 Q 621 -1 609.85 -1 Z" fill="url(#mx-gradient-ffffff-0.9-ffffff-0.1-s-0)" stroke="none" pointer-events="all"/></g><g><g transform="translate(-0.5 -0.5)"><switch><foreignObject pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility" style="overflow: visible; text-align: left;"><div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe center; width: 298px; height: 1px; padding-top: 30px; margin-left: 321px;"><div data-drawio-colors="color: #333333; " style="box-sizing: border-box; font-size: 0px; text-align: center;"><div style="display: inline-block; font-size: 12px; font-family: Helvetica; color: rgb(51, 51, 51); line-height: 1.2; pointer-events: all; white-space: normal; overflow-wrap: normal;">Horizontal</div></div></div></foreignObject><text x="470" y="34" fill="#333333" font-family=""Helvetica"" font-size="12px" text-anchor="middle">Horizontal</text></switch></g></g></g><g data-cell-id="QAD-4"><g><rect x="640" y="0" width="300" height="60" rx="9" ry="9" fill="#dae8fc" stroke="#6c8ebf" pointer-events="all"/><path d="M 650.15 -1 Q 639 -1 639 10.15 L 639 24 Q 790 42 941 24 L 941 10.15 Q 941 -1 929.85 -1 Z" fill="url(#mx-gradient-ffffff-0.9-ffffff-0.1-s-0)" stroke="none" pointer-events="all"/></g><g><g transform="translate(-0.5 -0.5)"><switch><foreignObject pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility" style="overflow: visible; text-align: left;"><div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe center; width: 298px; height: 1px; padding-top: 30px; margin-left: 641px;"><div data-drawio-colors="color: #333333; " style="box-sizing: border-box; font-size: 0px; text-align: center;"><div style="display: inline-block; font-size: 12px; font-family: Helvetica; color: rgb(51, 51, 51); line-height: 1.2; pointer-events: all; white-space: normal; overflow-wrap: normal;">Clicking on sections will show the steps in that section</div></div></div></foreignObject><text x="790" y="34" fill="#333333" font-family=""Helvetica"" font-size="12px" text-anchor="middle">Clicking on sections will show the steps in that s...</text></switch></g></g></g><g data-cell-id="QAD-5"><g><rect x="0" y="80" width="300" height="60" rx="9" ry="9" fill="#dae8fc" stroke="#6c8ebf" pointer-events="all"/><path d="M 10.15 79 Q -1 79 -1 90.15 L -1 104 Q 150 122 301 104 L 301 90.15 Q 301 79 289.85 79 Z" fill="url(#mx-gradient-ffffff-0.9-ffffff-0.1-s-0)" stroke="none" pointer-events="all"/></g><g><g transform="translate(-0.5 -0.5)"><switch><foreignObject pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility" style="overflow: visible; text-align: left;"><div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe center; width: 298px; height: 1px; padding-top: 110px; margin-left: 1px;"><div data-drawio-colors="color: #333333; " style="box-sizing: border-box; font-size: 0px; text-align: center;"><div style="display: inline-block; font-size: 12px; font-family: Helvetica; color: rgb(51, 51, 51); line-height: 1.2; pointer-events: all; white-space: normal; overflow-wrap: normal;">Clicking on attributes will show all attributes in the workflow</div></div></div></foreignObject><text x="150" y="114" fill="#333333" font-family=""Helvetica"" font-size="12px" text-anchor="middle">Clicking on attributes will show all attributes in...</text></switch></g></g></g><g data-cell-id="QAD-6"><g><rect x="320" y="80" width="300" height="60" rx="9" ry="9" fill="#dae8fc" stroke="#6c8ebf" pointer-events="all"/><path d="M 330.15 79 Q 319 79 319 90.15 L 319 104 Q 470 122 621 104 L 621 90.15 Q 621 79 609.85 79 Z" fill="url(#mx-gradient-ffffff-0.9-ffffff-0.1-s-0)" stroke="none" pointer-events="all"/></g><g><g transform="translate(-0.5 -0.5)"><switch><foreignObject pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility" style="overflow: visible; text-align: left;"><div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe center; width: 298px; height: 1px; padding-top: 110px; margin-left: 321px;"><div data-drawio-colors="color: #333333; " style="box-sizing: border-box; font-size: 0px; text-align: center;"><div style="display: inline-block; font-size: 12px; font-family: Helvetica; color: rgb(51, 51, 51); line-height: 1.2; pointer-events: all; white-space: normal; overflow-wrap: normal;">Clicking on prompts will show all prompts in the workflow</div></div></div></foreignObject><text x="470" y="114" fill="#333333" font-family=""Helvetica"" font-size="12px" text-anchor="middle">Clicking on prompts will show all prompts in the w...</text></switch></g></g></g><g data-cell-id="QAD-7"><g><rect x="640" y="80" width="300" height="60" rx="9" ry="9" fill="#dae8fc" stroke="#6c8ebf" pointer-events="all"/><path d="M 650.15 79 Q 639 79 639 90.15 L 639 104 Q 790 122 941 104 L 941 90.15 Q 941 79 929.85 79 Z" fill="url(#mx-gradient-ffffff-0.9-ffffff-0.1-s-0)" stroke="none" pointer-events="all"/></g><g><g transform="translate(-0.5 -0.5)"><switch><foreignObject pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility" style="overflow: visible; text-align: left;"><div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe center; width: 298px; height: 1px; padding-top: 110px; margin-left: 641px;"><div data-drawio-colors="color: #333333; " style="box-sizing: border-box; font-size: 0px; text-align: center;"><div style="display: inline-block; font-size: 12px; font-family: Helvetica; color: rgb(51, 51, 51); line-height: 1.2; pointer-events: all; white-space: normal; overflow-wrap: normal;">Clicking on dashboard will show visual hierarchy of the workflow</div></div></div></foreignObject><text x="790" y="114" fill="#333333" font-family=""Helvetica"" font-size="12px" text-anchor="middle">Clicking on dashboard will show visual hierarchy o...</text></switch></g></g></g><g data-cell-id="QAD-8"><g><rect x="0" y="160" width="300" height="60" rx="9" ry="9" fill="#dae8fc" stroke="#6c8ebf" pointer-events="all"/><path d="M 10.15 159 Q -1 159 -1 170.15 L -1 184 Q 150 202 301 184 L 301 170.15 Q 301 159 289.85 159 Z" fill="url(#mx-gradient-ffffff-0.9-ffffff-0.1-s-0)" stroke="none" pointer-events="all"/></g><g><g transform="translate(-0.5 -0.5)"><switch><foreignObject pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility" style="overflow: visible; text-align: left;"><div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe center; width: 298px; height: 1px; padding-top: 190px; margin-left: 1px;"><div data-drawio-colors="color: #333333; " style="box-sizing: border-box; font-size: 0px; text-align: center;"><div style="display: inline-block; font-size: 12px; font-family: Helvetica; color: rgb(51, 51, 51); line-height: 1.2; pointer-events: all; white-space: normal; overflow-wrap: normal;">Need a runs button</div></div></div></foreignObject><text x="150" y="194" fill="#333333" font-family=""Helvetica"" font-size="12px" text-anchor="middle">Need a runs button</text></switch></g></g></g><g data-cell-id="QAD-9"><g><rect x="320" y="160" width="300" height="60" rx="9" ry="9" fill="#dae8fc" stroke="#6c8ebf" pointer-events="all"/><path d="M 330.15 159 Q 319 159 319 170.15 L 319 184 Q 470 202 621 184 L 621 170.15 Q 621 159 609.85 159 Z" fill="url(#mx-gradient-ffffff-0.9-ffffff-0.1-s-0)" stroke="none" pointer-events="all"/></g><g><g transform="translate(-0.5 -0.5)"><switch><foreignObject pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility" style="overflow: visible; text-align: left;"><div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe center; width: 298px; height: 1px; padding-top: 190px; margin-left: 321px;"><div data-drawio-colors="color: #333333; " style="box-sizing: border-box; font-size: 0px; text-align: center;"><div style="display: inline-block; font-size: 12px; font-family: Helvetica; color: rgb(51, 51, 51); line-height: 1.2; pointer-events: all; white-space: normal; overflow-wrap: normal;">VCode Editor: https://chatgpt.com/c/e09e1367-db5e-4786-b362-db35805b1e20</div></div></div></foreignObject><text x="470" y="194" fill="#333333" font-family=""Helvetica"" font-size="12px" text-anchor="middle">VCode Editor: https://chatgpt.com/c/e09e1367-db5e-...</text></switch></g></g></g></g></g></g><switch><g requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility"/><a transform="translate(0,-5)" xlink:href="https://www.drawio.com/doc/faq/svg-export-text-problems" target="_blank"><text text-anchor="middle" font-size="10px" x="50%" y="100%">Text is not SVG - cannot display</text></a></switch></svg>
|
data/docs/requirements.md
CHANGED
@@ -1,5 +1,11 @@
|
|
1
1
|
# AppyDave - Agent Architecture Schema
|
2
2
|
|
3
|
+
GPT:
|
4
|
+
https://chatgpt.com/c/d938fd7c-28d4-4543-9246-eae6676d8aa5
|
5
|
+
https://chatgpt.com/c/e7b66d48-4134-4573-b5c6-54988e5f008c
|
6
|
+
https://chatgpt.com/c/e09e1367-db5e-4786-b362-db35805b1e20
|
7
|
+
|
8
|
+
|
3
9
|
## Purpose
|
4
10
|
|
5
11
|
The application is designed to handle structured workflows for building documents or text-based assets using LLMs from OpenAi, Anthropic and others. It should be adaptable to any workflow that follows a structured concept or a series of steps.
|
@@ -27,14 +27,14 @@ module Ad
|
|
27
27
|
db.create_table :workflows do
|
28
28
|
primary_key :id
|
29
29
|
String :name, null: false
|
30
|
-
String :description
|
30
|
+
String :description, null: true
|
31
31
|
end
|
32
32
|
|
33
33
|
db.create_table :sections do
|
34
34
|
primary_key :id
|
35
35
|
foreign_key :workflow_id, :workflows
|
36
36
|
String :name, null: false
|
37
|
-
String :description
|
37
|
+
String :description, null: true
|
38
38
|
Integer :order
|
39
39
|
end
|
40
40
|
|
@@ -43,7 +43,7 @@ module Ad
|
|
43
43
|
foreign_key :section_id, :sections
|
44
44
|
String :name, null: false
|
45
45
|
String :action, default: 'gpt'
|
46
|
-
String :description
|
46
|
+
String :description, null: true
|
47
47
|
Integer :order
|
48
48
|
String :prompt
|
49
49
|
end
|
@@ -52,6 +52,7 @@ module Ad
|
|
52
52
|
primary_key :id
|
53
53
|
foreign_key :workflow_id, :workflows
|
54
54
|
String :name, null: false
|
55
|
+
String :description, null: true
|
55
56
|
String :type
|
56
57
|
Boolean :is_array
|
57
58
|
end
|
@@ -74,6 +75,15 @@ module Ad
|
|
74
75
|
String :name, null: false
|
75
76
|
String :path, null: true
|
76
77
|
String :content, null: true
|
78
|
+
String :description, null: true
|
79
|
+
foreign_key :workflow_id, :workflows
|
80
|
+
end
|
81
|
+
|
82
|
+
db.create_table :settings do
|
83
|
+
primary_key :id
|
84
|
+
String :name, null: false
|
85
|
+
String :value
|
86
|
+
String :description, null: true
|
77
87
|
foreign_key :workflow_id, :workflows
|
78
88
|
end
|
79
89
|
|
@@ -11,6 +11,7 @@ module Ad
|
|
11
11
|
one_to_many :attributes, class: 'Ad::AgentArchitecture::Database::Attribute'
|
12
12
|
one_to_many :workflow_runs, class: 'Ad::AgentArchitecture::Database::WorkflowRun'
|
13
13
|
one_to_many :prompts, class: 'Ad::AgentArchitecture::Database::Prompt'
|
14
|
+
one_to_many :settings, class: 'Ad::AgentArchitecture::Database::Setting'
|
14
15
|
end
|
15
16
|
|
16
17
|
# Section model represents a section entity in the database.
|
@@ -47,10 +48,16 @@ module Ad
|
|
47
48
|
many_to_one :attribute, class: 'Ad::AgentArchitecture::Database::Attribute'
|
48
49
|
end
|
49
50
|
|
51
|
+
# Prompt model represents a prompt entity in the database.
|
50
52
|
class Prompt < Sequel::Model
|
51
53
|
many_to_one :workflow, class: 'Ad::AgentArchitecture::Database::Workflow'
|
52
54
|
end
|
53
55
|
|
56
|
+
# Setting model represents a setting entity in the database.
|
57
|
+
class Setting < Sequel::Model
|
58
|
+
many_to_one :workflow, class: 'Ad::AgentArchitecture::Database::Workflow'
|
59
|
+
end
|
60
|
+
|
54
61
|
# WorkflowRun model represents a workflow run entity in the database.
|
55
62
|
class WorkflowRun < Sequel::Model
|
56
63
|
many_to_one :workflow, class: 'Ad::AgentArchitecture::Database::Workflow'
|
@@ -6,22 +6,34 @@ module Ad
|
|
6
6
|
module Actions
|
7
7
|
# Save workflow graph to database
|
8
8
|
class SaveDatabase
|
9
|
-
|
10
|
-
|
9
|
+
attr_reader :workflow_id
|
10
|
+
|
11
|
+
def initialize(workflow)
|
12
|
+
@workflow_hash = workflow.data
|
11
13
|
end
|
12
14
|
|
13
15
|
def save
|
14
|
-
|
16
|
+
@workflow_id = nil
|
17
|
+
# puts JSON.pretty_generate(@workflow_hash)
|
15
18
|
DB.transaction do
|
16
19
|
# puts "Saving Workflow: #{@workflow_hash[:name]}"
|
17
20
|
# Save workflow
|
18
|
-
workflow_record = Ad::AgentArchitecture::Database::Workflow.create(
|
21
|
+
workflow_record = Ad::AgentArchitecture::Database::Workflow.create(
|
22
|
+
name: @workflow_hash[:name],
|
23
|
+
description: @workflow_hash[:description]
|
24
|
+
)
|
25
|
+
|
26
|
+
@workflow_id = workflow_record.id
|
19
27
|
|
20
28
|
# Saving attributes
|
21
29
|
attribute_records = @workflow_hash[:attributes].map do |_name, attr|
|
22
30
|
# puts "Saving Attribute: #{attr}"
|
23
31
|
Ad::AgentArchitecture::Database::Attribute.create(
|
24
|
-
name: attr[:name],
|
32
|
+
name: attr[:name],
|
33
|
+
type: attr[:type],
|
34
|
+
is_array: attr[:is_array],
|
35
|
+
description: attr[:description],
|
36
|
+
workflow: workflow_record
|
25
37
|
)
|
26
38
|
end
|
27
39
|
|
@@ -31,7 +43,22 @@ module Ad
|
|
31
43
|
@workflow_hash[:prompts].each_value do |prompt|
|
32
44
|
# puts "Saving Prompt: #{prompt}"
|
33
45
|
Ad::AgentArchitecture::Database::Prompt.create(
|
34
|
-
name: prompt[:name],
|
46
|
+
name: prompt[:name],
|
47
|
+
path: prompt[:path],
|
48
|
+
content: prompt[:content],
|
49
|
+
description: prompt[:description],
|
50
|
+
workflow: workflow_record
|
51
|
+
)
|
52
|
+
end
|
53
|
+
|
54
|
+
# Save settings
|
55
|
+
@workflow_hash[:settings].each do |name, setting|
|
56
|
+
puts "Saving Setting: #{setting}"
|
57
|
+
Ad::AgentArchitecture::Database::Setting.create(
|
58
|
+
name: name.to_s,
|
59
|
+
value: setting[:value],
|
60
|
+
description: setting[:description],
|
61
|
+
workflow: workflow_record
|
35
62
|
)
|
36
63
|
end
|
37
64
|
|
@@ -39,32 +66,42 @@ module Ad
|
|
39
66
|
@workflow_hash[:sections].each do |section|
|
40
67
|
# puts "Saving Section: #{section}"
|
41
68
|
section_record = Ad::AgentArchitecture::Database::Section.create(
|
42
|
-
name: section[:name],
|
69
|
+
name: section[:name],
|
70
|
+
order: section[:order],
|
71
|
+
description: section[:description],
|
72
|
+
workflow: workflow_record
|
43
73
|
)
|
44
74
|
|
45
75
|
section[:steps].each do |step|
|
46
76
|
# puts "Saving Step: #{step}"
|
47
77
|
step_record = Ad::AgentArchitecture::Database::Step.create(
|
48
|
-
name: step[:name],
|
78
|
+
name: step[:name],
|
79
|
+
order: step[:order],
|
80
|
+
prompt: step[:prompt],
|
81
|
+
description: step[:description],
|
82
|
+
section: section_record
|
49
83
|
)
|
50
84
|
|
51
85
|
step[:input_attributes].each do |attr_name|
|
52
86
|
# puts "Saving Input Attribute for Step: #{attr_name}"
|
53
87
|
Ad::AgentArchitecture::Database::InputAttribute.create(
|
54
|
-
step: step_record,
|
88
|
+
step: step_record,
|
89
|
+
attribute: attribute_map[attr_name.to_sym]
|
55
90
|
)
|
56
91
|
end
|
57
92
|
|
58
93
|
step[:output_attributes].each do |attr_name|
|
59
94
|
# puts "Saving Output Attribute for Step: #{attr_name}"
|
60
95
|
Ad::AgentArchitecture::Database::OutputAttribute.create(
|
61
|
-
step: step_record,
|
96
|
+
step: step_record,
|
97
|
+
attribute: attribute_map[attr_name.to_sym]
|
62
98
|
)
|
63
99
|
end
|
64
100
|
end
|
65
101
|
end
|
66
102
|
end
|
67
|
-
|
103
|
+
@workflow_id
|
104
|
+
rescue StandardError => e
|
68
105
|
puts "An error occurred: #{e.message}"
|
69
106
|
raise
|
70
107
|
end
|
@@ -8,13 +8,12 @@ module Ad
|
|
8
8
|
module Actions
|
9
9
|
# Save workflow graph to JSON file
|
10
10
|
class SaveJson
|
11
|
-
def initialize(
|
12
|
-
@
|
11
|
+
def initialize(hash)
|
12
|
+
@hash = hash
|
13
13
|
end
|
14
14
|
|
15
15
|
def save(file_name)
|
16
|
-
|
17
|
-
File.write(file_name, JSON.pretty_generate(@workflow_hash))
|
16
|
+
File.write(file_name, JSON.pretty_generate(@hash))
|
18
17
|
end
|
19
18
|
end
|
20
19
|
end
|
@@ -6,17 +6,22 @@ module Ad
|
|
6
6
|
# This class is responsible for defining the agent DSL
|
7
7
|
class AgentDsl
|
8
8
|
attr_reader :workflow
|
9
|
+
attr_accessor :workflow_id
|
9
10
|
|
10
|
-
def self.create(name, &block)
|
11
|
-
new(name).tap do |dsl|
|
11
|
+
def self.create(name, description: nil, &block)
|
12
|
+
new(name, description: description).tap do |dsl|
|
12
13
|
dsl.instance_eval(&block) if block_given?
|
13
14
|
end
|
14
15
|
end
|
15
16
|
|
16
|
-
def
|
17
|
+
def description(description)
|
18
|
+
@workflow.description(description)
|
19
|
+
end
|
20
|
+
|
21
|
+
def initialize(name, description: nil)
|
17
22
|
raise ArgumentError, 'Agent name must be a string or symbol' unless name.is_a?(String) || name.is_a?(Symbol)
|
18
23
|
|
19
|
-
@workflow = WorkflowDsl.new(name)
|
24
|
+
@workflow = WorkflowDsl.new(name, description: description)
|
20
25
|
end
|
21
26
|
|
22
27
|
def settings(&block)
|
@@ -31,28 +36,33 @@ module Ad
|
|
31
36
|
@workflow.prompts(&block)
|
32
37
|
end
|
33
38
|
|
34
|
-
def section(name, &block)
|
39
|
+
def section(name, description: nil, &block)
|
35
40
|
raise ArgumentError, 'Section name must be a string or symbol' unless name.is_a?(String) || name.is_a?(Symbol)
|
36
41
|
|
37
|
-
@workflow.section(name, &block)
|
42
|
+
@workflow.section(name, description: description, &block)
|
38
43
|
end
|
39
44
|
|
40
45
|
def save
|
41
|
-
Ad::AgentArchitecture::Dsl::Actions::SaveDatabase.new(@workflow
|
46
|
+
id = Ad::AgentArchitecture::Dsl::Actions::SaveDatabase.new(@workflow).save
|
47
|
+
@workflow_id = id
|
42
48
|
|
43
49
|
self
|
44
50
|
end
|
45
51
|
|
46
52
|
def save_json(file_name = nil)
|
47
53
|
full_file_name = file_name || 'workflow.json'
|
48
|
-
|
54
|
+
raise ArgumentError, 'Workflow needs to be saved, befor you can save JSON' unless @workflow_id
|
55
|
+
|
56
|
+
Ad::AgentArchitecture::Dsl::Actions::SaveJson.new(@workflow_id).save(full_file_name)
|
49
57
|
|
50
58
|
self
|
51
59
|
end
|
52
60
|
|
53
61
|
def save_yaml(file_name = nil)
|
54
62
|
full_file_name = file_name || 'workflow.yaml'
|
55
|
-
|
63
|
+
raise ArgumentError, 'Workflow needs to be saved, befor you can save YAML' unless @workflow_id
|
64
|
+
|
65
|
+
Ad::AgentArchitecture::Dsl::Actions::SaveYaml.new(@workflow_id).save(full_file_name)
|
56
66
|
|
57
67
|
self
|
58
68
|
end
|
@@ -5,10 +5,36 @@ module Ad
|
|
5
5
|
module Dsl
|
6
6
|
# This class is responsible for defining the attributes of a workflow
|
7
7
|
class AttributeDsl < ChildDsl
|
8
|
-
|
8
|
+
attr_reader :current_attribute
|
9
|
+
|
10
|
+
def attribute(name, type: :string, is_array: false, description: nil, &block)
|
9
11
|
raise ArgumentError, 'Attribute name must be a string or symbol' unless name.is_a?(String) || name.is_a?(Symbol)
|
10
12
|
|
11
|
-
|
13
|
+
@current_attribute = { name: name, type: type, is_array: is_array, description: description }
|
14
|
+
|
15
|
+
attributes[name] = current_attribute
|
16
|
+
|
17
|
+
instance_eval(&block) if block_given?
|
18
|
+
|
19
|
+
self
|
20
|
+
end
|
21
|
+
|
22
|
+
def description(description)
|
23
|
+
current_attribute[:description] = description
|
24
|
+
|
25
|
+
self
|
26
|
+
end
|
27
|
+
|
28
|
+
def type(type)
|
29
|
+
current_attribute[:type] = type
|
30
|
+
|
31
|
+
self
|
32
|
+
end
|
33
|
+
|
34
|
+
def is_array(is_array)
|
35
|
+
current_attribute[:is_array] = is_array
|
36
|
+
|
37
|
+
self
|
12
38
|
end
|
13
39
|
end
|
14
40
|
end
|
@@ -17,6 +17,11 @@ module Ad
|
|
17
17
|
settings[name.to_sym] || settings[name.to_s]
|
18
18
|
end
|
19
19
|
|
20
|
+
def setting_value(name, default: nil)
|
21
|
+
lookup = get_setting(name)
|
22
|
+
lookup ? lookup[:value] : default
|
23
|
+
end
|
24
|
+
|
20
25
|
def attributes
|
21
26
|
data[:attributes]
|
22
27
|
end
|
@@ -33,9 +38,9 @@ module Ad
|
|
33
38
|
prompts[name.to_sym] || prompts[name.to_s]
|
34
39
|
end
|
35
40
|
|
36
|
-
def
|
41
|
+
def prompt_content(name, default: nil)
|
37
42
|
lookup = get_prompt(name)
|
38
|
-
lookup ? lookup[:content] :
|
43
|
+
lookup ? lookup[:content] : default
|
39
44
|
end
|
40
45
|
end
|
41
46
|
end
|
@@ -5,17 +5,37 @@ module Ad
|
|
5
5
|
module Dsl
|
6
6
|
# This class is responsible for defining the prompts of a workflow
|
7
7
|
class PromptDsl < ChildDsl
|
8
|
-
|
8
|
+
attr_reader :current_prompt
|
9
|
+
|
10
|
+
def prompt(name, path: nil, content: nil, description: nil, &block)
|
9
11
|
raise ArgumentError, 'Prompt name must be a string or symbol' unless name.is_a?(String) || name.is_a?(Symbol)
|
10
12
|
|
11
|
-
|
13
|
+
@current_prompt = { name: name, path: path, content: content, description: description }
|
14
|
+
|
15
|
+
prompts[name] = current_prompt
|
16
|
+
|
17
|
+
instance_eval(&block) if block_given?
|
18
|
+
|
19
|
+
self
|
20
|
+
end
|
21
|
+
|
22
|
+
def description(description)
|
23
|
+
current_prompt[:description] = description
|
24
|
+
|
25
|
+
self
|
26
|
+
end
|
27
|
+
|
28
|
+
def content(content)
|
29
|
+
current_prompt[:content] = content
|
30
|
+
|
31
|
+
self
|
12
32
|
end
|
13
33
|
|
14
|
-
def
|
34
|
+
def load_file(file)
|
15
35
|
prompt_path = settings[:prompt_path]
|
16
36
|
raise 'Prompt path not defined in settings. Set "prompt_path" to the path where you are keping prompts' unless prompt_path
|
17
37
|
|
18
|
-
full_path = File.join(prompt_path, file)
|
38
|
+
full_path = File.join(prompt_path[:value], file)
|
19
39
|
File.read(full_path)
|
20
40
|
end
|
21
41
|
end
|
@@ -5,19 +5,27 @@ module Ad
|
|
5
5
|
module Dsl
|
6
6
|
# This class is responsible for creating a section in the workflow
|
7
7
|
class SectionDsl < ChildDsl
|
8
|
-
def initialize(workflow, name, order)
|
8
|
+
def initialize(workflow, name, order, description: nil)
|
9
9
|
super(workflow)
|
10
10
|
|
11
|
-
@section = { name: name, order: order, steps: [] }
|
11
|
+
@section = { name: name, order: order, description: description, steps: [] }
|
12
12
|
sections << @section
|
13
13
|
@current_step_order = 1
|
14
14
|
end
|
15
15
|
|
16
|
-
def
|
16
|
+
def description(description)
|
17
|
+
@section[:description] = description
|
18
|
+
|
19
|
+
self
|
20
|
+
end
|
21
|
+
|
22
|
+
def step(name, description: nil, &block)
|
17
23
|
raise ArgumentError, 'Step name must be a string or symbol' unless name.is_a?(String) || name.is_a?(Symbol)
|
18
24
|
|
19
|
-
StepDsl.new(workflow, @section, name, @current_step_order).instance_eval(&block)
|
25
|
+
StepDsl.new(workflow, @section, name, @current_step_order, description: description).instance_eval(&block)
|
20
26
|
@current_step_order += 1
|
27
|
+
|
28
|
+
self
|
21
29
|
end
|
22
30
|
end
|
23
31
|
end
|
@@ -5,9 +5,9 @@ module Ad
|
|
5
5
|
module Dsl
|
6
6
|
# This class is responsible for defining the settings of a workflow
|
7
7
|
class SettingsDsl < ChildDsl
|
8
|
-
def method_missing(name, *args, &block)
|
8
|
+
def method_missing(name, *args, **kwargs, &block)
|
9
9
|
if args.length == 1 && block.nil?
|
10
|
-
data[:settings][name] = args.first
|
10
|
+
data[:settings][name] = { value: args.first, description: kwargs[:description] }
|
11
11
|
else
|
12
12
|
super
|
13
13
|
end
|
@@ -10,11 +10,12 @@ module Ad
|
|
10
10
|
attr_reader :section
|
11
11
|
attr_reader :step
|
12
12
|
|
13
|
-
def initialize(workflow, section, name, order)
|
13
|
+
def initialize(workflow, section, name, order, description: nil)
|
14
14
|
super(workflow)
|
15
15
|
@step = {
|
16
16
|
name: name,
|
17
17
|
order: order,
|
18
|
+
description: description,
|
18
19
|
prompt: '',
|
19
20
|
input_attributes: [],
|
20
21
|
output_attributes: []
|
@@ -37,9 +38,13 @@ module Ad
|
|
37
38
|
end
|
38
39
|
|
39
40
|
def prompt(prompt, **_opts)
|
40
|
-
|
41
|
+
content = prompt_content(prompt)
|
42
|
+
@step[:prompt] = content || prompt
|
43
|
+
self
|
44
|
+
end
|
41
45
|
|
42
|
-
|
46
|
+
def description(description)
|
47
|
+
@step[:description] = description
|
43
48
|
self
|
44
49
|
end
|
45
50
|
|