Files
agno/cookbook/90_models/dashscope/README.md
T
Harsh e5651dcc36 fix: cookbooks stale paths left by the directory renumber (#9789)
## Summary

`cookbook/90_tools` and `cookbook/92_models` were renumbered to
`91_tools` and `90_models` by #6042 (2026-01-19), and #6515 (the v2.5
restructure) deleted a set of per-provider examples. Neither pass
updated the references. 296 `cookbook/...` paths across the repo pointed
at directories and files that no longer exist, and nothing in CI checks
path references, so this went unnoticed for seven months.

This resolves every reference that has a live target, removes the
entries whose target no longer exists anywhere, and fixes one case that
was breaking at runtime rather than in docs.

### Runtime fix

`cookbook/frameworks/langgraph/langgraph_session_agentos.py` passed
`app="langgraph_tools_agentos:app"` to `agent_os.serve`. `AgentOS.serve`
hands a string straight to uvicorn, which imports that module — and
`langgraph_tools_agentos` does not exist, so the example could never
start. It now self-references.

### Path fixes

- `cookbook/92_models/...` -> `cookbook/90_models/...`, resolved
folder-locally so a README never points at another provider's file
- pre-restructure flat paths: `cookbook/storage/`, `cookbook/db/`,
`cookbook/agents/`, `cookbook/07_knowledge/cloud|protocol|vector_db/`
- `cookbook/run_pgvector.sh` -> `cookbook/scripts/run_pgvector.sh`;
`./scripts/run_mongodb.sh` -> `./cookbook/scripts/run_mongodb.sh` (7
files)
- self-references in files that moved a directory deeper
(`06_storage/*`, `07_knowledge/09_archive/*`, `frameworks/langgraph/*`,
`91_tools/google/workspace/*`, `91_tools/workspace_tools/*`,
`91_tools/scheduler_tools.py`)
- `storage.py` -> each provider's own `db.py` (renamed per provider;
only `meta/llama_openai` kept the old name)
- renamed successors: `image_agent.py` -> `image_input_url.py`
(anthropic), `image_input.py` (gemini), `image_agent_bytes.py` (watsonx)
- `CONTRIBUTING.md`: four paths that misdirect new contributors, plus
`tools/toolkit/toolkit.py` -> `tools/toolkit.py`
- `08_learning/setup_venv.sh`: `venv_setup.sh` (words transposed) and
`1_user_profile_always.py` -> `1a_user_profile_always.py`

### Removals — target deleted upstream, not renamed

- 8 sections whose script exists nowhere: 6 `async_*` examples folded
into `basic.py` in v3.0, plus `aws/bedrock` storage/knowledge (that
folder has neither file; sibling `aws/claude` does and keeps both
sections)
- 83 `- Streaming on` / `- Streaming off` bullets. Every v3.0 `basic.py`
runs Sync, Sync+Streaming, Async and Async+Streaming in its `__main__`,
so both labels were factually wrong, not only the ones whose file was
deleted.

### Label corrections

- `perplexity` §5 ran `cohere/tool_use.py`; now runs its own
`web_search.py`, bullet relabelled from "DuckDuckGo Search"
- `azure/ai_foundry` ran four `azure/openai/*.py` scripts; now runs its
own
- `litellm` said "DuckDuckGo Search" but the script imports
`YFinanceTools` -> "Financial data"
- `mistral` said "DuckDuckGo search" but the script defines a local
`@tool` -> "Custom tool"

Section numbering is resequenced in every README a removal touched.

## Type of change

- [x] Bug fix
- [ ] New feature
- [ ] Breaking change
- [x] Improvement
- [ ] Model update
- [ ] Other:

---

## Checklist

- [x] Code complies with style guidelines
- [x] Ran format/validation scripts (`./scripts/format.sh` and
`./scripts/validate.sh`)
- [x] Self-review completed
- [x] Documentation updated (comments, docstrings)
- [x] Examples and guides: Relevant cookbook examples have been included
or updated (if applicable)
- [x] Tested in clean environment
- [ ] Tests added/updated (if applicable)

### Duplicate and AI-Generated PR Check

- [x] I have searched existing [open pull requests](../../pulls) and
confirmed that no other PR already addresses this issue
- [x] If a similar PR exists, I have explained below why this PR is a
better approach
- [ ] Check if this PR was entirely AI-generated (by Copilot, Claude
Code, Cursor, etc.)

---

## Additional Notes
2026-08-26 10:34:54 +05:30

1.1 KiB

DashScope Cookbook

1. Create and activate a virtual environment

python3 -m venv ~/.venvs/aienv
source ~/.venvs/aienv/bin/activate

2. Export your DASHSCOPE_API_KEY or QWEN_API_KEY

Get your API key from: https://modelstudio.console.alibabacloud.com/?tab=model#/api-key

export DASHSCOPE_API_KEY=***

3. Install libraries

uv pip install -U openai ddgs agno

4. Run basic Agent

python cookbook/90_models/dashscope/basic.py

5. Run Agent with Tools

  • DuckDuckGo Search
python cookbook/90_models/dashscope/tool_use.py

6. Run Agent that returns structured output

python cookbook/90_models/dashscope/structured_output.py

7. Run Agent that analyzes images

  • Basic image analysis
python cookbook/90_models/dashscope/image_agent.py
  • Image analysis with bytes
python cookbook/90_models/dashscope/image_agent_bytes.py

For more information about Qwen models and capabilities, visit: