Async Basic Agent

Run a SiliconFlow agent asynchronously with aprint_response.

Code

import asyncio

from agno.agent import Agent
from agno.models.siliconflow import Siliconflow

agent = Agent(model=Siliconflow(id="openai/gpt-oss-120b", base_url="https://api.siliconflow.com/v1"), markdown=True)

asyncio.run(agent.aprint_response("Share a 2 sentence horror story"))

These examples use the SiliconFlow global service: create a key in the global console and use https://api.siliconflow.com/v1. Choose a model available to that account. For a China-region account, use its key, model catalog and https://api.siliconflow.cn/v1 instead. The Agno adapter defaults to the China endpoint when base_url is omitted.

Usage

Set up your virtual environment

uv venv --python 3.12
source .venv/bin/activate

Set your API key

export SILICONFLOW_API_KEY=xxx

Install dependencies

uv pip install -U agno openai

Run Agent

Save the code above as basic.py, then run:

python basic.py