updated quickstarts to use the updated sync workflow monitoring

This commit is contained in:
Roberto Rodriguez 2025-04-22 11:58:01 -04:00
parent e8d96e186d
commit 704e9d774b
6 changed files with 7 additions and 9 deletions

View File

@ -27,7 +27,7 @@ def write_blog(outline: str) -> str:
if __name__ == '__main__':
wfapp = WorkflowApp()
results = wfapp.run_and_monitor_workflow(
results = wfapp.run_and_monitor_workflow_sync(
analyze_topic,
input="AI Agents"
)

View File

@ -234,7 +234,7 @@ def write_blog(outline: str) -> str:
if __name__ == '__main__':
wfapp = WorkflowApp()
results = wfapp.run_and_monitor_workflow(
results = wfapp.run_and_monitor_workflow_sync(
analyze_topic,
input="AI Agents"
)

View File

@ -103,7 +103,7 @@ def get_line(character: str) -> str:
if __name__ == '__main__':
wfapp = WorkflowApp()
results = wfapp.run_and_monitor_workflow(task_chain_workflow)
results = wfapp.run_and_monitor_workflow_sync(task_chain_workflow)
print(f"Famous Line: {results}")
```
@ -209,7 +209,7 @@ if __name__ == "__main__":
research_topic = "The environmental impact of quantum computing"
logging.info(f"Starting research workflow on: {research_topic}")
results = wfapp.run_and_monitor_workflow(research_workflow, input=research_topic)
results = wfapp.run_and_monitor_workflow_sync(research_workflow, input=research_topic)
logging.info(f"\nResearch Report:\n{results}")
```

View File

@ -73,6 +73,6 @@ if __name__ == "__main__":
research_topic = "The environmental impact of quantum computing"
logging.info(f"Starting research workflow on: {research_topic}")
results = wfapp.run_and_monitor_workflow(research_workflow, input=research_topic)
results = wfapp.run_and_monitor_workflow_sync(research_workflow, input=research_topic)
if len(results) > 0:
logging.info(f"\nResearch Report:\n{results}")

View File

@ -26,5 +26,5 @@ def get_line(character: str) -> str:
if __name__ == '__main__':
wfapp = WorkflowApp()
results = wfapp.run_and_monitor_workflow(task_chain_workflow)
results = wfapp.run_and_monitor_workflow_sync(task_chain_workflow)
print(f"Famous Line: {results}")

View File

@ -5,8 +5,6 @@ from dotenv import load_dotenv
# Load environment variables
load_dotenv()
# Initialize the WorkflowApp
# Define Workflow logic
@workflow(name='task_chain_workflow')
def task_chain_workflow(ctx: DaprWorkflowContext):
@ -31,5 +29,5 @@ def get_line(character: str) -> str:
if __name__ == '__main__':
wfapp = WorkflowApp()
results = wfapp.run_and_monitor_workflow(task_chain_workflow)
results = wfapp.run_and_monitor_workflow_sync(task_chain_workflow)
print(f"Results: {results}")