-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Schema: define basic schema for workflow #27
Comments
Working draft of a workflow apiVersion: beehive/v1
kind: Workflow
metadata:
name: beehive-deployment
labels:
app: mas-example
spec:
strategy:
type: sequence
output: verbose
template:
metadata:
labels:
app: mas-example
agents:
- name: agent1
- name: agent2
- name: agent3
prompt: Here is where I would put the prompt I would give to my multi-agent workflow
|
Did you upload the example workflow that you presented in demo @psschwei? Also similar question @developer-gliu? I want to ensure schema matches. ideally we should have these in a |
Yes, it's in a top-level |
OK folks, so for the schema I did some research and the best approach is to use JSON schema. Since YAML can be converted to JSON (and vice versa) then the same JSON schema can be used to validate the YAML. This is my first attempt: Proposed schema for the current agreed upon workflow — does not include conditional since we need to agree on that; see my comment in PR #124 {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://github.com/i-am-bee/bee-hive/workflow.schema.json",
"title": "Bee Hive",
"description": "A schema for defining Bee Hive workflows in YAML or JSON",
"type": "object",
"properties": {
"apiVersion": "string",
"kind": "string",
"metadata": {
"name": "string",
"labels": "object"
},
"spec": {
"strategy": {
"type": "sequence"
},
"template": {
"metadata": {
"name": "string",
"labels": "object"
}
}
},
"agents": [],
"exception": "string",
"steps": []
}
}
A valid JSON and YAML for this schema follows: {
"apiVersion": "beehive/v1",
"kind": "Workflow",
"metadata": {
"name": "beehive-deployment",
"labels": {
"app": "example2"
}
},
"spec":{
"strategy": {
"type": "sequence"
},
"template": {
"metadata": {
"name": "beehive-deployment",
"labels": {
"app": "example",
"use-case": "test"
}
}
},
"agents": [
"agent1",
"agent2",
"agent3"
],
"exception": "step4",
"steps": [
"step1",
"step2",
"step3",
"step4"
],
"step1": {
"agent": "agent1"
},
"step2": {
"agent": "agent2"
},
"step3": {
"agent": "agent1"
},
"step4": {
"agent": "agent3"
}
}
} ---
apiVersion: beehive/v1
kind: Workflow
metadata:
name: beehive-deployment
labels:
app: example2
spec:
strategy:
type: sequence
template:
metadata:
name: beehive-deployment
labels:
app: example
use-case: test
agents:
- agent1
- agent2
- agent3
exception: step4
steps:
- step1
- step2
- step3
- step4
step1:
agent: agent1
step2:
agent: agent2
step3:
agent: agent1
step4:
agent: agent3 Please comment directly here. I will submit my PR that uses this schema and the two tests workflows for this issue. Finally, since we will need various iterations as we evolve the workflow language and schema, I will open a similar issue for each iterations. |
Just to prevent possible issues, for the The rest of the schema make sense to me |
|
I commented in Aki's PR, but one thing that jumps out to me in the schema is that this hardcodes the steps: steps:
- step1
- step2
- step3
- step4
step1:
agent: agent1
step2:
agent: agent2
step3:
agent: agent1
step4:
agent: agent3 Could we define a |
so are you suggesting something like:
|
correct |
Closing this #133 solves |
…ixes #136] (#139) * first version of the JSON schema. Fixes issue #27 * addressing feedback from review * addressed steps and agents definition * made agents also array * first version of the agent schema that validares the agents used in POC0 * added code section * included suggestions and changes from @akihikokuroda's PR #139 review comments
* first version of the JSON schema. Fixes issue #27 * addressing feedback from review * addressed steps and agents definition * made agents also array * first version of the agent schema that validares the agents used in POC0 * added code section * included suggestions and changes from @akihikokuroda's PR #139 review comments * first version of schema with conditionals (both if/then/else and case/do/default). Added some tests files in test/schema/conditional_workdlow.<yml/json> * feat(internal): Refactor to provide base Agent class & allow for alternate runtimes (#146) Signed-off-by: Nigel Jones <[email protected]> * feat(bee-hive) add schema validator (#147) Signed-off-by: Akihiko Kuroda <[email protected]> * corrected schema according to @akihikokuroda comments and added a new test based on comments discussions: funnier_workflow.<yml|json> --------- Signed-off-by: Nigel Jones <[email protected]> Signed-off-by: Akihiko Kuroda <[email protected]> Co-authored-by: Nigel Jones <[email protected]> Co-authored-by: Akihiko (Aki) Kuroda <[email protected]>
…ixes #136] (#139) * first version of the JSON schema. Fixes issue #27 * addressing feedback from review * addressed steps and agents definition * made agents also array * first version of the agent schema that validares the agents used in POC0 * added code section * included suggestions and changes from @akihikokuroda's PR #139 review comments
* first version of the JSON schema. Fixes issue #27 * addressing feedback from review * addressed steps and agents definition * made agents also array * first version of the agent schema that validares the agents used in POC0 * added code section * included suggestions and changes from @akihikokuroda's PR #139 review comments * first version of schema with conditionals (both if/then/else and case/do/default). Added some tests files in test/schema/conditional_workdlow.<yml/json> * feat(internal): Refactor to provide base Agent class & allow for alternate runtimes (#146) Signed-off-by: Nigel Jones <[email protected]> * feat(bee-hive) add schema validator (#147) Signed-off-by: Akihiko Kuroda <[email protected]> * corrected schema according to @akihikokuroda comments and added a new test based on comments discussions: funnier_workflow.<yml|json> --------- Signed-off-by: Nigel Jones <[email protected]> Signed-off-by: Akihiko Kuroda <[email protected]> Co-authored-by: Nigel Jones <[email protected]> Co-authored-by: Akihiko (Aki) Kuroda <[email protected]>
As a user, I want a defined schema to write my beehive workflow in.
This is related with #47 and #48
The text was updated successfully, but these errors were encountered: