python-sdk icon indicating copy to clipboard operation
python-sdk copied to clipboard

feat: Add LLM provider adapter documentation and examp

Open dgenio opened this issue 4 weeks ago • 0 comments

Summary

This PR addresses #235 by providing comprehensive documentation and examples for creating adapters that convert MCP tool schemas to various LLM provider formats (Gemini, OpenAI, Claude).

Changes

  • New documentation page (docs/llm-adapters.md): Comprehensive guide covering:

    • Basic adapter patterns
    • Complete implementations for Gemini, OpenAI, and Anthropic Claude
    • Advanced schema transformations (nested objects, arrays, enums)
    • Error handling patterns
    • Best practices
  • Runnable example (examples/snippets/clients/llm_adapter_example.py): Demonstrates:

    • Connecting to MCP servers
    • Listing and converting tools
    • Batch conversion with error handling
    • Validation utilities
  • Documentation updates: Added references in:

    • docs/index.md - Getting Started section
    • README.md - Advanced Usage and Documentation sections
    • mkdocs.yml - Navigation menu

Design Decision

Following maintainer feedback, this PR provides documentation and examples rather than official adapter utilities. This approach:

  • Makes it easy for developers to create adapters
  • Avoids maintenance burden of third-party SDK dependencies
  • Provides clear patterns and best practices
  • Includes working examples for all three major providers

Testing

  • ✅ All files pass linting (ruff, pyright)
  • ✅ Documentation follows mkdocs format
  • ✅ Example script is registered and runnable
  • ✅ No breaking changes (documentation only)

Related

Closes #235

dgenio avatar Dec 01 '25 13:12 dgenio