v1.0.0-release
Release Notes - Version 1.0.0
Major Changes 🚀
This release represents a complete refactoring of ollama-instructor, focusing on better integration with the Ollama client and improved reliability.
Breaking Changes ⚠️
- Complete rewrite of core classes to inherit directly from Ollama's official Client classes
- Removed
OllamaInstructorClientandOllamaInstructorAsyncClientin favor ofOllamaInstructorandOllamaInstructorAsync - Removed
allow_partialvalidation feature - Removed
pydantic_modelas parameter - Standardized parameter naming.
formatnow take the Pydantic BaseModel instead of parameterpydantic_model - Removed option for
''andjsonfor parameterformat. - Changed method names
- Removed requirement for explicit async initialization
New Features ✨
- Direct inheritance from Ollama's
ClientandAsyncClientclasses - Improved logging system using Python's built-in logging module
- Simplified API that matches Ollama's native interface more closely
- Enhanced retry mechanism using
staminalibrary
API Changes 📝
Old API:
client = OllamaInstructorClient()
response = client.chat_completion(
pydantic_model=MyModel,
format='json' # or ''
# ...
)New API:
client = OllamaInstructor(enable_logging=True)
response = client.chat_completion(
format=MyModel,
# ...
)Improvements 🔨
- More robust error handling
- Better integration with Ollama's native features
- Cleaner codebase with better type hints
- Improved streaming functionality
- More consistent behavior between sync and async implementations
Migration Guide 🔄
To migrate from version 0.5.2:
- Update class names to
OllamaInstructororOllamaInstructorAsync - Replace
pydantic_modelparameter withformat - Remove any
allow_partialparameters - Update streaming calls to use
chat_streaminstead ofchat_completion_with_stream - Remove async initialization calls (
async_init()) - If you have used
''for parameterformat, replace with Pydantic BaseModel
Please refer to example folder for usage of classes and methods. Click here
Full Changelog: v0.5.2...v1.0.0-release