A Python client for the Gumloop API that makes it easy to run and monitor Gumloop flows.
pip install gumloopfrom gumloop import GumloopClient
# Initialize the client
client = GumloopClient(
api_key="your_api_key",
user_id="your_user_id"
)
# Run a flow and wait for outputs
output = client.run_flow(
flow_id="your_flow_id",
inputs={
"recipient": "example@email.com",
"subject": "Hello",
"body": "World"
}
)
print(output)import asyncio
from gumloop import AsyncGumloop
async def main() -> None:
async with AsyncGumloop(access_token="your_access_token") as client:
agents = await client.agents.list()
agent = agents.agents[0]
async for event in client.sessions.stream(
agent.id,
input="Hello, what can you do?",
):
print(event)
asyncio.run(main())