v0.4.0
Pre-release
Pre-release
BREAKING CHANGES
Kani.full_round
now emits every message generated during the round, not just assistant messages- This means that you will need to handle
FUNCTION
messages, and potentiallySYSTEM
messages from a function exception handler. Kani.full_round_str
's default behaviour is unchanged.
- This means that you will need to handle
Kani.full_round_str
now takes in amessage_formatter
rather than afunction_call_formatter
- By default, this handler only returns the contents of
ASSISTANT
messages.
- By default, this handler only returns the contents of
Kani.do_function_call
now returns aFunctionCallResult
rather than abool
- To migrate any overriding functions, you should change the following:
- Rather than calling
Kani.add_to_history
in the override, save the ChatMessage to a variable - Update the return value from a boolean to
FunctionCallResult(is_model_turn=<old return value>, message=<message from above>)
Kani.handle_function_call_exception
now returns aExceptionHandleResult
rather than abool
- To migrate any overriding functions, you should change the following:
- Rather than calling
Kani.add_to_history
in the override, save the ChatMessage to a variable - Update the return value from a boolean to
ExceptionHandleResult(should_retry=<old return value>, message=<message from above>)
Improvements
- Added
kani.utils.message_formatters
- Added
kani.ExceptionHandleResult
andkani.FunctionCallResult
- Documentation improvements
Fixes
- Fixed an issue where
ChatMessage.copy_with
could cause unset values to appear in JSON serializations