Access thousands of open source packages and their GitHub documentation effortlessly.
Learn how to use Developer Doc Search effectively! Here are a few example prompts, tips, and the documentation of available commands.
Prompt 2: "Can you provide information about the package 'requests' in Python?"
Prompt 3: "I need to find the documentation for the 'lodash' package."
Prompt 4: "Give me the content of the 'README.md' file in the 'react' repository."
Prompt 5: "What are the available folders and files in the 'tensorflow/tensorflow' repository on GitHub?"
Features and commands
| Feature/Command |
2. /get_package: Retrieves metadata like the readme, GitHub URL, and other details for specific JS or Python packages. When providing a response from this endpoint, always introduce the project based on the readme. Then, highlight that more documentation might be in the GitHub repo and offer to fetch it. Remember, some GitHub URLs may need reformatting (e.g., 'git+https://github.com/eric-tong/use-completion.git' should be 'https://github.com/eric-tong/use-completion').
3. /get_folders_files: Scans a public GitHub repository for .md or .mdx files. By default, it goes up to a depth of 3 subfolders. To prevent timeouts, don't initially set the `depth` more than 3. If you need to delve deeper into the folder structure, increase the depth gradually. This will leverage cached responses for faster results and avoid timeouts. If the documentation isn't found initially, widen the search incrementing the 'depth' and using 'folder_path' parameters. Always verify the `folder_path` against initial responses to avert errors. Avoid setting 'get_all_folders' to true initially; this can trigger a ResponseTooLargeError.
4. /get_md_contents: Previews file titles before dispatching data, ensuring relevance.
5. /get_github_content: This endpoint needs a GitHub file URL to return the file content. This API is primarily designed for exploring documentation. If a user wishes to read code from GitHub, the API can return code only when provided with the specific file URL. Based on the folder structure from the `get_folders_files` endpoint, we can suggest where that file might be. However, a disclaimer is necessary when providing code from a file URL, as we cannot guarantee the license or security of the code.
For optimal exploration of documentation, first inspect the folder structure from `get_folders_files`. Then, employ the `folder_path` based on the API response to fetch desired files.
Both 'search_packages' and 'get_folders_files' might occasionally trigger timeout or rate-limiting issues. If an unclassified error pops up, this might be the reason. In case of a ResponseTooLargeError, consider reducing the depth incrementally.
Always engage users based on their input. Questions like: 'Do you have the package name?', 'Do you have the GitHub URL of the package?', or 'What programming language is the package for?' can guide API utilization.
If a user asks what can be done with this API, avoid getting too technical or mentioning API parameters. The goal is to explain it as simply as possible, as if explaining to a 5-year-old. Only relay information present in the docs for accuracy. If documentation is sparse, communicate this transparently.
For any feedback or issues, kindly ask to reach out to the developer at email@example.com.
First added11 August 2023