Skip to content

Commit

Permalink
wrap workflow.run with asyncio.run
Browse files Browse the repository at this point in the history
Signed-off-by: Akihiko Kuroda <[email protected]>
  • Loading branch information
akihikokuroda committed Feb 24, 2025
1 parent 2348cb9 commit 6a67fc3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion maestro/cli/commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
# limitations under the License.

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

from openai import OpenAI
from jsonschema.exceptions import ValidationError, SchemaError
Expand Down Expand Up @@ -171,7 +172,7 @@ def __init__(self, args):
def __run_agents_workflow(self, agents_yaml, workflow_yaml):
try:
workflow = Workflow(agents_yaml, workflow_yaml[0])
workflow.run()
asyncio.run(workflow.run())
except Exception as e:
self._check_verbose()
raise RuntimeError("Unable to run workflow: {message}".format(message=str(e)))
Expand Down
3 changes: 2 additions & 1 deletion maestro/deployments/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import json
import sys
import io
import asyncio

import yaml
from src.workflow import Workflow
Expand All @@ -27,7 +28,7 @@ def process_workflow():

output = io.StringIO()
sys.stdout = output
workflow_instance.run()
asyncio.run(workflow_instance.run())
sys.stdout = sys.__stdout__

response = {
Expand Down

0 comments on commit 6a67fc3

Please sign in to comment.