Commit Graph

14 Commits

  • feat(ai): Add cross-provider message handoff support
    - Add transformMessages utility to handle cross-provider compatibility
    - Convert thinking blocks to <thinking> tagged text when switching providers
    - Preserve native thinking blocks when staying with same provider/model
    - Add comprehensive handoff tests verifying all provider combinations
    - Fix OpenAI Completions to return partial results on abort
    - Update tool call ID format for Anthropic compatibility
    - Document cross-provider handoff capabilities in README
  • feat(ai): Add start event emission to all providers
    - Emit start event with model and provider info after creating stream
    - Add abort signal tests for all providers
    - Update README abort signal section to reflect non-throwing API
    - Fix model references in README examples
  • docs(ai): Add all event types to streaming example
    - Add 'start' event with model/provider info
    - Add 'done' event with stop reason and usage stats
    - Add 'error' event handling
    - Show more detailed event data in examples
  • docs(ai): Update README for new content blocks API
    - Add API changes section explaining v0.5.15+ changes
    - Update Quick Start example to show content array usage
    - Update Tool Calling example to filter tool calls from content blocks
    - Update Streaming example to use new onEvent callback
    - Fix model IDs in provider-specific examples
  • docs(ai): Fix model names in README examples
    - Changed gpt-4o-mini to gpt-5-mini in examples to match actual model names
    - Minor formatting fixes
  • docs(ai): Improve README with model discovery and capabilities documentation
    - Added note that library only includes tool-calling capable models
    - Added Model Discovery section showing how to enumerate models
    - Added examples for finding models with specific capabilities
    - Added cache read/write costs to model capabilities display
    - Clarified that models are auto-fetched from APIs at build time
  • feat(ai): Rename package to @mariozechner/pi-ai and improve documentation
    - Changed package name from @mariozechner/ai to @mariozechner/pi-ai
    - Fixed generate-models.ts to fetch from models.dev API instead of local file
    - Completely rewrote README with practical examples:
      - Image input with base64 encoding
      - Proper tool calling with context management
      - Streaming with completion indicators
      - Abort signal usage
      - Provider-specific options (reasoning/thinking)
      - Custom model definitions for local/self-hosted LLMs
      - Environment variables explanation
    - Bumped version to 0.5.9 and published
  • refactor(ai): Implement unified model system with type-safe createLLM
    - Add Model interface to types.ts with normalized structure
    - Create type-safe generic createLLM function with provider-specific model constraints
    - Generate models from OpenRouter API and models.dev data
    - Strip provider prefixes for direct providers (google, openai, anthropic, xai)
    - Keep full model IDs for OpenRouter-proxied models
    - Clean separation: types.ts (Model interface), models.ts (factory logic), models.generated.ts (data)
    - Remove old model scripts and unused dependencies
    - Rename GeminiLLM to GoogleLLM for consistency
    - Add tests for new providers (xAI, Groq, Cerebras, OpenRouter)
    - Support 181 tool-capable models across 7 providers with full type safety
  • feat(ai): Add models.dev data integration
    - Add models script to download latest model information
    - Create models.ts module to query model capabilities
    - Include models.json in package distribution
    - Export utilities to check model features (reasoning, tools)
    - Update build process to copy models.json to dist
  • feat(ai): Add OpenAI-compatible provider examples for multiple services
    - Add examples for Cerebras, Groq, Ollama, and OpenRouter
    - Update OpenAI Completions provider to handle base URL properly
    - Simplify README formatting
    - All examples use the same OpenAICompletionsLLM provider with different base URLs
  • docs(ai): Update README with working quick start examples
    - Replace planned features with actual working code examples
    - Add clear provider comparison table
    - Show real imports and usage patterns
    - Include streaming, thinking, and tool calling examples
    - Update supported models to match current implementation
  • feat(ai): Create unified AI package with OpenAI, Anthropic, and Gemini support
    - Set up @mariozechner/ai package structure following monorepo patterns
    - Install OpenAI, Anthropic, and Google Gemini SDK dependencies
    - Document comprehensive API investigation for all three providers
    - Design minimal unified API with streaming-first architecture
    - Add models.dev integration for pricing and capabilities
    - Implement automatic caching strategy for all providers
    - Update project documentation with package creation guide