Qwen-Agent is a Python library designed to enhance Large Language Models (LLMs) with advanced capabilities such as Agent Workflows, Retrieval-Augmented Generation (RAG), Function Calling, and Code Interpreters. It's actively developed, with version 0.0.34 released recently, maintaining a rapid release cadence with frequent minor updates.
pip install qwen-agentVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates how to initialize an `AssistantAgent` with a Code Interpreter tool and use it to execute a simple task. It requires an API key for DashScope (for Qwen models) or OpenAI, which should be set as an environment variable.
Ensure `DASHSCOPE_API_KEY` or `OPENAI_API_KEY` is set in your environment or explicitly passed in the `llm_config` dictionary. Double-check `model_server` matches your `model` and API key.
If using MCP-dependent features, refer to the official documentation for specific installation and configuration instructions, as it may not be part of the base `qwen-agent` install.
For complex or lengthy tasks, consider adjusting these limits by setting the `QWEN_AGENT_MAX_LLM_CALL_PER_RUN` and `QWEN_AGENT_DEFAULT_MAX_INPUT_TOKENS` environment variables before running the agent.
Install `qwen-agent[gui]` to ensure the correct `gradio` version is used. If problems persist, check the library's `pyproject.toml` or `setup.py` for the exact `gradio` version pinned and adjust your environment accordingly.