Skip to main content

Add an AI Assistant to your `/docs` page.

Project description

DocBuddy

Add an AI assistant to your /docs page.

Features

  • 💬 AI chat assistant with full OpenAPI context
  • 🤖 LLM Settings panel with local providers (Ollama, LM Studio, vLLM, Custom)
  • 🔗 Tool-calling for API Requests
  • 🎨 Dark/light theme support

Installation

pip install docbuddy

Quick Start

from fastapi import FastAPI
from docbuddy import setup_docs

app = FastAPI()
setup_docs(app)  # replaces default /docs

That's it! Visit /docs

Configure LLM Settings

This plugin uses client-side JavaScript to connect to your local LLM provider. You can configure it in the LLM Settings tab in the Swagger UI:

  • Provider: Choose your local LLM provider (Ollama, LM Studio, vLLM, or Custom)
  • API URL: Enter the API endpoint for your LLM (e.g. http://localhost:1234/v1 for LMStudio)
  • Test Connection: Verify that the plugin can connect to your LLM provider and select a model from the drop down after.

Some local LLM providers will require additional configuration to work with the plugin. For example, LM Studio users will need to enable CORS in their LM Studio settings to allow the plugin to connect from the browser.

Using the Chat Assistant

Ask questions like:

  • "What endpoints are available?"
  • "Show me how to use /users"
  • "Generate a curl command for /health"

Users can enable tool calling in the settings to allow the assistant to make API requests on your behalf. This allows for more interactive and dynamic conversations with the assistant.

Development

pip install -e ".[dev]"
pytest tests/

Demo Server

uvicorn examples.demo_server:app --reload

Future Developments

  • More LLM providers (Azure, Hugging Face, etc.)
  • Support for reasoning chains in chat and workflow
  • Update styling for Authenticated API and authorize button in /docs page
  • Support for other web frameworks like Flask, Django, etc.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

docbuddy-0.4.0.tar.gz (943.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

docbuddy-0.4.0-py3-none-any.whl (42.0 kB view details)

Uploaded Python 3

File details

Details for the file docbuddy-0.4.0.tar.gz.

File metadata

  • Download URL: docbuddy-0.4.0.tar.gz
  • Upload date:
  • Size: 943.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.10

File hashes

Hashes for docbuddy-0.4.0.tar.gz
Algorithm Hash digest
SHA256 ef8d10406c2615878df731415231a5b7e5e7cf14e77a2b7460177d03ced694b2
MD5 08e3c8276a482f7bc1727b56cf368b40
BLAKE2b-256 e862fefd67ca5d72f8c2c222ebd7eaf8bf8eb242585fa04b82d86fe75354cb6e

See more details on using hashes here.

File details

Details for the file docbuddy-0.4.0-py3-none-any.whl.

File metadata

  • Download URL: docbuddy-0.4.0-py3-none-any.whl
  • Upload date:
  • Size: 42.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.10

File hashes

Hashes for docbuddy-0.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 0c04d5692253a51ac25ac0b6a972dab39cc4e5765030602942fed1679dcdb8c2
MD5 655be14309e373ae5e6c420536d96065
BLAKE2b-256 03dfb5e4aa0900799ec12ede9c59024a460a1c106a71591557c7c678f7b8af65

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page