Skip to content

Hello World example fails in Jupyter #77

Closed
@cmbant

Description

@cmbant

The trivial Hello World example uses an event loop via run_sync, which immediately gives error in Jupyter notebook because there's already an event loop - another example may be better, e.g. this works

result = await Runner.run(agent, "Write a haiku about recursion in programming.")

The problem is documented somewhere, but quite offputting for new user trying to get started:

"""Run a workflow synchronously, starting at the given agent. Note that this just wraps the

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationImprovements or additions to documentation

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions