All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to SimpleTool.
- Added AsyncExitStack import from contextlib
- Completely rewrote the aexit method to use AsyncExitStack for better resource management
- Key improvements:
- Uses AsyncExitStack to properly manage both async and sync resources
- Handles context managers directly through enter_async_context and enter_context
- Uses push_async_callback and push_callback for explicit resource cleanup
- Better error handling with more descriptive logging
- Cleaner code structure with proper async/await patterns
- added
_auto_track_large_object
method to track large objects and prevent memory leaks - add
factory
create method to create SimpleTool instances - tool.info now return
Dict
and notstr
- Make SimpleTool picklable - only serializing essential attributes
- add output_schema in info property
- add AsyncExitStack for tracking async resources
- missing
SimpleTool
name and description validation rules
- add
name
anddescription
validation Field rules inSimpleToolResponseModel
- add str to
ResourceConent
-uri field to match rfc3986 uris
ImageContent
- rename data -> imageFileContent
- rename data -> fileErrorContent
- rename message -> error
- incorrect
SimpleToolResponseModel
Pydantic model configuration + from_attributes allow easy serialize/deserialize
- incorrect github action workflow for
setup.py
version
- SimpleToolResponseModel
- add correct handle repr for SimpleTool child classes
- add get_version for
setup.py
to automate version update - auto add annotation version in
__init__.py
- Updated test import from
BoolContents
toBoolContent
to match type definition
- added
input_model
will be mandatory - as mapping SimpleInputModel to SimpleTool input_schema
will be from now generated based oninput_model
(and will not be able to be ovveriden)- added
output_model
+output_schema
will be generated based on return type ofrun
method - types for return (1 base + 6 subclasses):
- Content - base class
- TextContent - for text based content
- ImageContent - for image based content
- FileContent - for file based content
- ResourceContent - for resource based content
- BoolContent - for boolean based content
- ErrorContent - for error based content
- ready to use own SimpleTool class naming convention
- added empty main to load module smoothly w/o any errors
- adding a context manager for resource cleanup (auto clean in aexit method)
- implement timeout mechanisms for long-running tools
- remove
execute
def option from Tool class - make it SIMPLE -> handled byrun
method option (only) - added own SimpleInputSchema class which is used to extract json schema from input types
- by default json schema extraction for SimpleInputSchema will remove
title
anddescription
fields
- test which cover decorator @validate_tool_output - used to check if users return only valid list of elements types
- added FileContent which return encoded base64 file content and mime of this file
- added in ResourceContents mandatory
name
attribute and optionaldescription
attribute - as server needs to be able to identify resource also by thename
(which will work asid
in database)
- run/execute should return Sequence (which is covariant) instead of List (which is invariant) - that should fully allow return mix of types with no linter warnings
- allow List of mixtures of ContentT to be returned from tool
- tool should from now always return list of elements - List[ContentT]
- select_random_api_key where value is empty string cause error
- add proper validation of run/execute output type (validate_tool_output decorator) this will allow only to use as output: Union[List[ContentT], ErrorData] where: ContentT = TypeVar('ContentT', ImageContent, TextContent, EmbeddedResource)
- upgrade to 0.0.2 breaks loading of tool (#1).
- run test now will now run Autopep8 to fix some formating issues and Flake8 linting on test files
- documentation in README.md
- run_test.py - manual run test
- fix some formating flake8 comp
- autorun github workflow on change version in setup.py
0.0.1 - 2025-01-01
- Init project
- This CHANGELOG file to hopefully serve as an evolving example of a standardized open source project CHANGELOG.