Skip to content

v2.1.0

Choose a tag to compare

@ovac ovac released this 07 Sep 09:24
· 20 commits to master since this release

v2.1.0 — AI Chat, Request Tester, Theme Polish

This release adds an optional AI Chat assistant to iDoc’s documentation view and multiple UI refinements (light/dark syntax highlighting, stable floating action buttons, and robust interactivity across theme changes). You can disable Chat via env if you don’t need it.

What’s New

  • AI Chat (optional): Conversational assistant that answers questions about your API using your generated OpenAPI (and optional extra context view).
  • Provider Chooser: If no key is configured, Chat shows clickable options with a copyable .env snippet for quick setup.
  • Dual Syntax Highlight: Light/dark highlight.js themes that switch with the docs theme toggle.
  • Stable Floating Actions: Theme / Chat / Try‑It buttons consolidated into one fixed stack so layout stays stable when features are disabled.

Providers

  • DeepSeek (default)
  • OpenAI (ChatGPT)
  • Google Gemini
  • Groq (OpenAI‑compatible)
  • Hugging Face Inference API
  • Together AI (OpenAI‑compatible)
  • OpenAI‑compatible local servers (LM Studio, llama.cpp server)

Quick Start (DeepSeek default)

Add to your .env:

IDOC_CHAT_ENABLED=true
IDOC_CHAT_PROVIDER=deepseek
IDOC_CHAT_MODEL=deepseek-chat
IDOC_CHAT_BASE_URL=https://api.deepseek.com/v1
DEEPSEEK_API_KEY=your_deepseek_key

Apply:

php artisan config:clear && php artisan cache:clear

Other Providers (Examples)

OpenAI (ChatGPT)

IDOC_CHAT_ENABLED=true
IDOC_CHAT_PROVIDER=openai
IDOC_CHAT_MODEL=gpt-4o-mini
IDOC_CHAT_BASE_URL=https://api.openai.com/v1
OPENAI_API_KEY=your_openai_key

Google Gemini

IDOC_CHAT_ENABLED=true
IDOC_CHAT_PROVIDER=google
IDOC_CHAT_MODEL=gemini-1.5-flash
IDOC_CHAT_BASE_URL=https://generativelanguage.googleapis.com/v1beta
GOOGLE_API_KEY=your_google_api_key

Groq

IDOC_CHAT_ENABLED=true
IDOC_CHAT_PROVIDER=groq
IDOC_CHAT_MODEL=mixtral-8x7b-32768
IDOC_CHAT_BASE_URL=https://api.groq.com/openai/v1
GROQ_API_KEY=your_groq_key

Hugging Face Inference API

IDOC_CHAT_ENABLED=true
IDOC_CHAT_PROVIDER=huggingface
IDOC_CHAT_MODEL=Qwen/Qwen2.5-7B-Instruct
IDOC_CHAT_BASE_URL=https://api-inference.huggingface.co
HF_API_TOKEN=your_hf_token

Self‑hosted (OpenAI‑compatible)

IDOC_CHAT_ENABLED=true
IDOC_CHAT_PROVIDER=openai
IDOC_CHAT_BASE_URL=http://127.0.0.1:8000/v1
IDOC_CHAT_MODEL=qwen2.5-7b-instruct
IDOC_CHAT_API_KEY=localdev

Tip: If Chat isn’t required, disable it by setting IDOC_CHAT_ENABLED=false.

Improvements

  • Light Theme Polish: Better contrast for bubbles/buttons; code blocks are readable in light mode.
  • Event Delegation: Provider chips and Copy/Back buttons in Chat remain interactive after theme changes.
  • Try‑It Headers UI: Cleaner headers popover with JSON validation and persisted state.
  • Syntax Highlight Switching: Auto‑switch between light/dark highlight.js themes with the docs theme.

Migration Notes

  • If you previously published the docs view and customized it, re‑publish to get the new features:
php artisan vendor:publish --tag=idoc-views --force
  • Optional: review new config keys:
php artisan vendor:publish --tag=idoc-config
  • Set env as shown above for your provider; clear caches after:
php artisan config:clear && php artisan cache:clear

Maintainer Checklist

  • Tag: v2.1.0
  • Confirm CHANGELOG includes v2.1.0
  • Publish release on GitHub and Packagist