- Replace createLLM with getModel/getModels/getProviders functions
- Rename PROVIDERS to MODELS (internal only, not exposed)
- Add streamSimple/completeSimple for unified reasoning interface
- Update README with new API examples and comprehensive documentation
- Remove model registration (models are now fixed from build time)
- Add proper TypeScript typing for provider-specific options
- Document context serialization, cross-provider handoffs, and browser usage
- Implement QueuedGenerateStream class that extends AsyncIterable with finalMessage() method
- Add new types: GenerateStream, GenerateOptions, GenerateOptionsUnified, GenerateFunction
- Create generateAnthropic function-based implementation replacing class-based approach
- Add comprehensive test suite for the new generate API
- Support streaming events with text, thinking, and tool call deltas
- Map ReasoningEffort to provider-specific options
- Include apiKey in options instead of constructor parameter
- Test handling of empty content arrays
- Test handling of empty string content
- Test handling of whitespace-only content
- All providers handle these edge cases gracefully
- Updated generate-models.ts to fetch these providers directly from models.dev API
- OpenRouter now only used for xAI and other third-party providers
- Fixed test model IDs to match new model names from models.dev
- Removed unused import from google.ts
- Add getApi() method to all providers to identify the API type
- Add api field to AssistantMessage to track which API generated it
- Update transformMessages to check API compatibility instead of model
- Fixes issue where OpenAI Responses API failed when switching models
- Preserves thinking blocks and signatures when staying within same API
- Required header for browser-based access to Anthropic API
- Added to both OAuth and regular API key authentication
- Ensures full browser compatibility
- 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
- Anthropic, Google, and OpenAI Responses providers now return partial results when aborted
- Restructured streaming to accumulate content blocks incrementally
- Prevents submission of thinking/toolCall blocks from aborted completions in multi-turn conversations
- Makes UI development easier by providing partial content even when requests are interrupted
- Add inlineSources: true to embed TypeScript source in source maps
- Keeps source maps in separate files (inlineSourceMap: false)
- Enables proper debugging and breakpoints when using packages from npm
- 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
- 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
- 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
- Collect complete output items during streaming instead of building blocks incrementally
- Handle reasoning summary parts with proper newline separation
- Support refusal content in message outputs
- Preserve full reasoning items and message IDs for multi-turn resubmission
- Emit proper streaming events for text and thinking deltas
BREAKING CHANGE: AssistantMessage now uses content array instead of separate fields
- Changed AssistantMessage.content from string to array of content blocks
- Removed separate thinking, toolCalls, and signature fields
- Content blocks can be TextContent, ThinkingContent, or ToolCall types
- Updated streaming events to include start/end events for text and thinking
- Fixed multiTurn test to handle new content structure
Note: Currently only Anthropic provider is updated to work with new API
Other providers need to be updated to match the new interface
- Added contentSignature tracking for assistant messages
- Fixed message format in convertToResponsesFormat (output_text instead of input_text)
- Properly preserve message IDs for multi-turn conversations
- Added proper ResponseOutputMessage type satisfaction
- Updated tests to cover more providers and multi-turn scenarios
- Added dangerouslyAllowBrowser: true to OpenAI client initialization
- Allows usage of the library in browser environments
- Applies to both OpenAICompletionsLLM and OpenAIResponsesLLM
- Added @mariozechner/pi-ai package to the structure
- Updated features to include unified LLM API
- Expanded supported providers list
- Updated tech stack with multiple SDKs
- Added architecture details for AI package
- Updated version numbers to current 0.5.12
- Added testing information for AI package (Vitest)
- Included all packages in build order example
- Moved completed AI package implementation task to done folder
- Task successfully implemented the unified AI API (@mariozechner/pi-ai)
- Package renamed, documentation improved, and published as v0.5.12
- 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
- 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
- Added image tests to OpenAI Completions (gpt-4o-mini)
- Added image tests to Anthropic (claude-sonnet-4-0)
- Added image tests to Google (gemini-2.5-flash)
- Tests verify models can process and describe the red circle test image
- Change ImageContent to simple { type, data, mimeType } structure
- Remove URL and file path support from core interface
- Simplify provider converters to work with base64 data only
- Update validation and implementation considerations
- Clarify that preprocessing is user's responsibility
- Document image support for Anthropic, Google GenAI, OpenAI APIs
- Include format requirements, size limits, and API examples
- Propose unified abstraction layer for cross-provider image handling
- Add implementation examples for format conversion and validation