import asynciofrom agno.agent import Agent, RunResponsefrom agno.models.ibm import WatsonXagent = Agent(model=WatsonX(id="ibm/granite-20b-code-instruct"), markdown=True)# Get the response in a variable# run: RunResponse = agent.run("Share a 2 sentence horror story")# print(run.content)# Print the response in the terminalasyncio.run(agent.aprint_response("Share a 2 sentence horror story"))
This example shows how to use the asynchronous API of Agno with IBM WatsonX. It creates an agent and uses asyncio.run() to execute the asynchronous aprint_response method.