python_get_documentation
Retrieve Python library documentation with a natural language query. Specify library, version, and number of results to access consolidated, up-to-date reference material in one call.
Instructions
Primary Python documentation lookup tool. Use this for every Python documentation-related query.
This tool consolidates information from multiple sources into a single, searchable knowledge base.
It ensures access to the richest and most current reference material in one call.
Args:
query: A natural language question (e.g., "How do I define a Deployment?").
library: Python library to search documentation for.
version: Optional Library version (e.g., "4.46.1"). Defaults to detected library version if not specified.
top_k: Optional number of top matching documents to return. Defaults to 10.
Returns:
A list of dictionaries, each containing document path and corresponding content.
Example Usage:
# Search Python docs for Transformers
python_get_documentation(query="what is a transformers mlm token", library="transformers", version="4.46.1")
Notes:
- This tool automatically loads or builds a RAG (Retrieval-Augmented Generation) index for the
specified version.
- If an index is not found locally, the tool will fetch and index the documentation before responding.
- You should call this function for any question that needs project documentation context.
Input Schema
Name | Required | Description | Default |
---|---|---|---|
library | Yes | Python library to search documentation for. | |
query | Yes | A natural language question (e.g., "How do I use transformers?"). | |
top_k | No | Optional number of top matching documents to return. Defaults to 10. | |
version | No | Optional Library version (e.g., "4.46.1"). Defaults to detected library version if not specified. |