Skip to content

Commit

Permalink
Fixes issue 221 but fixing remaining CI issues after restructure (#225)
Browse files Browse the repository at this point in the history
* * remove all references to Bee-Hive, Bee Hive, Hive, bee-hive, bee hive, and hive
* fix tools/check-schemas.sh
* fix all unit tests so that pytest runs green

* rebase

* fix demo tests workflow

* fix CI: demos workflow

* fix CI: demos workflow

* fix CI: demos workflow

* fix CI: demos workflow

* fix CI: demos workflow
  • Loading branch information
maximilien authored Feb 14, 2025
1 parent 8e9f196 commit 4ab8c2a
Show file tree
Hide file tree
Showing 39 changed files with 89 additions and 336 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ jobs:
- name: Run CrewAI workflow
run: |
cd maestro
poetry run demos/demos/activity-planner-crewai.ai/run.py
demos/workflows/activity-planner-crewai.ai/run.sh
# TODO: Add a way to check the output of the demo
env:
MAESTRO_DEMO_OLLAMA_MODEL: ollama/llama3.2:3b
1 change: 1 addition & 0 deletions .python-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3.12.8
11 changes: 8 additions & 3 deletions maestro/cli/commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@
# See the License for the specific language governing permissions and
# limitations under the License.

import os, yaml, json, jsonschema
import os, yaml, json, jsonschema, traceback

from openai import OpenAI
from jsonschema.exceptions import ValidationError
from jsonschema.exceptions import ValidationError, SchemaError

from common import Console, parse_yaml
from src.workflow import Workflow
from cli.common import Console, parse_yaml

# Root CLI class
class CLI:
Expand Down Expand Up @@ -120,6 +120,11 @@ def validate(self):
Console.ok("YAML file is valid.")
except ValidationError as ve:
Console.error("YAML file is NOT valid:\n {error_message}".format(error_message=str(ve.message)))
if self.verbose():
print(traceback.format_exc())
return 1
except SchemaError as se:
Console.error("Schema file is NOT valid:\n {error_message}".format(error_message=str(se.message)))
return 1
return 0

Expand Down
4 changes: 2 additions & 2 deletions maestro/demos/README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# bee-hive-demos
Demos and use cases of bee hive
# maestro-demos
Demos and use cases of Maestro

## Example environment setup using Podman Desktop, docker-compose, bee-stack, and local Ollama
### bee-stack setup
Expand Down
4 changes: 2 additions & 2 deletions maestro/demos/agents/crewai/activity_planner/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

Simple agent which given a prompt including a city, will suggest things to do in the cold or wet weather

Primarily this is to support a demonstration of how a Crew.AI Crew can be integrated into beehive. Note that a crew can be composed of multiple agents
Primarily this is to support a demonstration of how a Crew.AI Crew can be integrated into Maestro. Note that a crew can be composed of multiple agents

# Requirements

Expand All @@ -13,7 +13,7 @@ Primarily this is to support a demonstration of how a Crew.AI Crew can be integr

# Running

* Run `bee-hive-demos/agents/crewai/activity_planner.py` via shell command line, or IDE such as vscode
* Run `demos/agents/crewai/activity_planner.py` via shell command line, or IDE such as vscode

## Future enhancements

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ This is a simple demonstration of a workflow that uses a third party agent - in

# Running

* Run `bee-hive-demos/demos/activity-planner-crewai.ai/run.py` via shell command line, or IDE such as vscode
* Run `demos/activity-planner-crewai.ai/run.py` via shell command line, or IDE such as vscode

# Caveats

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
apiVersion: beehive/v1alpha1
apiVersion: maestro/v1alpha1
kind: Agent
metadata:
name: activity_planner.ActivityPlannerCrew.activity_crew
Expand Down
34 changes: 0 additions & 34 deletions maestro/demos/workflows/activity-planner-crewai.ai/run.py

This file was deleted.

2 changes: 1 addition & 1 deletion maestro/demos/workflows/activity-planner-crewai.ai/run.sh
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
#! /bin/bash
# TODO break down the hive shell script into two pieces - commands required to run the demo go here
# TODO break down the maestro shell script into two pieces - commands required to run the demo go here
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
#! /bin/bash
# TODO break down the hive shell script into two pieces - commands required to set up the demo go here
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
apiVersion: beehive/v1alpha1
apiVersion: maestro/v1alpha1
kind: Workflow
metadata:
name: beehive-deployment
name: maestro-deployment
labels:
app: activity-planner-demo
spec:
Expand Down
4 changes: 2 additions & 2 deletions maestro/demos/workflows/activity-planner.ai/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@ TODO the demo does not currently function out of the box as the workflow schema

# Activity-Planner example

A multi-agent workflow using Bee-Hive to check if the current temperature in a location is hotter or colder than average and recommend activities to do based on the weather.
A multi-agent workflow using Maestro to check if the current temperature in a location is hotter or colder than average and recommend activities to do based on the weather.

## Getting Started

* Run a local instance of the [bee-stack](https://github.com/i-am-bee/bee-stack/blob/main/README.md)

* Verify a valid llm is available to bee-stack

* Install [bee-hive](https://github.com/i-am-bee/bee-hive) dependencies: `cd ../../../bee-hive/bee-hive && poetry shell && poetry install && cd -`
* Install [maestro](https://github.com/i-am-bee/beeai-labs) dependencies: `cd ../../../maestro && poetry shell && poetry install && cd -`

* Configure environmental variables: `cp example.env .env`

Expand Down
8 changes: 4 additions & 4 deletions maestro/demos/workflows/activity-planner.ai/agents.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
apiVersion: beehive/v1alpha1
apiVersion: maestro/v1alpha1
kind: Agent
metadata:
name: current-affairs
Expand All @@ -12,7 +12,7 @@ spec:
- weather
instructions: An input is given of a location. Use the OpenMeteo tool to get today's current forecast for the location. Return results in the format - location, temperature in Fahrenheit, and date.
---
apiVersion: beehive/v1alpha1
apiVersion: maestro/v1alpha1
kind: Agent
metadata:
name: hot-or-not
Expand All @@ -26,7 +26,7 @@ spec:
- weather
instructions: Use the OpenMeteo weather tool to find the historical temperature of the given location. Determine if the input temperature is warmer or colder than the historical temperature. Respond with "hotter" or "colder" and include the location name.
---
apiVersion: beehive/v1alpha1
apiVersion: maestro/v1alpha1
kind: Agent
metadata:
name: cold-activities
Expand All @@ -40,7 +40,7 @@ spec:
- web_search
instructions: The input a location that is currently colder than normal. Perform a web search to find fun activities to do in the colder near the location and recommend five.
---
apiVersion: beehive/v1alpha1
apiVersion: maestro/v1alpha1
kind: Agent
metadata:
name: hot-activities
Expand Down
2 changes: 1 addition & 1 deletion maestro/demos/workflows/activity-planner.ai/setup.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#! /bin/bash
cp example.env .env
cp .env ./../common/src
cd ../../../bee-hive
cd ../../../maestro
poetry env activate
poetry install
cd -
Expand Down
2 changes: 1 addition & 1 deletion maestro/demos/workflows/activity-planner.ai/src/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import sys
import yaml
from bee_hive import Workflow
from src.workflow import Workflow
import dotenv

dotenv.load_dotenv()
Expand Down
14 changes: 7 additions & 7 deletions maestro/demos/workflows/activity-planner.ai/workflow.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
apiVersion: beehive/v1alpha1
apiVersion: maestro/v1alpha1
kind: Workflow
metadata:
name: beehive-deployment
name: maestro-deployment
labels:
app: mas-example
spec:
Expand All @@ -21,13 +21,13 @@ spec:
steps:
- name: current-affairs
agent: current-affairs
condition:
- default:
do: hot-or-not
condition:
- case: (input.find('hotter') != -1)
do: hot-activities
- default: cold-activities
- name: hot-or-not
agent: hot-or-not
condition:
- if: (input.find('hotter') != -1)
do: hot-activities
else: cold-activities
- name: end
else: cold-activities
78 changes: 0 additions & 78 deletions maestro/demos/workflows/common/src/create_agents.py

This file was deleted.

Loading

0 comments on commit 4ab8c2a

Please sign in to comment.