Kani

Latest version: v1.2.4

Safety actively analyzes 688823 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 3 of 6

0.8.0

Most likely the last release before v1.0! This update mostly contains improvements to `chat_in_terminal` to improve usability in interactive environments like Jupyter Notebook.

Possible Breaking Change

All arguments to `chat_in_terminal` except the Kani instance must now be keyword arguments; positional arguments are no longer accepted.

For example, `chat_in_terminal(ai, 1, "!stop")` must now be written `chat_in_terminal(ai, rounds=1, stopword="!stop")`.

Improvements

- You may now specify `None` as the user query in `chat_round` and `full_round`. This will request a new ASSISTANT message without adding a USER message to the chat history (e.g. to continue an unfinished generation).

Added the following keyword args to `chat_in_terminal` to improve usability in interactive environments like Jupyter Notebook:

- echo: Whether to echo the user's input to stdout after they send a message (e.g. to save in interactive notebook outputs; default false)
- ai_first: Whether the user should send the first message (default) or the model should generate a completion before prompting the user for a message.
- width: The maximum width of the printed outputs (default unlimited).
- show_function_args: Whether to print the arguments the model is calling functions with for each call (default false).
- show_function_returns: Whether to print the results of each function call (default false).
- verbose: Equivalent to setting ``echo``, ``show_function_args``, and ``show_function_returns`` to True.

0.7.2

- OpenAI: Added support for Jan 25 models without specifying `max_context_length` explicitly
- OpenAI: Fixed an issue where the token count for parallel function calls would only consider the first function call

0.7.1

- OpenAI: Fixes an issue where a tool call could have an unbound tool call ID when using `always_included_messages` near the maximum context length

0.7.0

New Features
- Added support for the Claude API through the `AnthropicEngine`
- Currently, this is only for chat messages - we don't yet have access to the new function calling API. We plan to add Claude function calling to Kani as soon as we get access!
- Renamed `ToolCallError` to a more general `PromptError`
- Technically a minor breaking change, though a search of GitHub shows that no one has used `ToolCallError` yet

Fixes
- Fixed an issue where parallel tool calls could not be validated (thanks arturoleon!)

0.6.2

- Fixes an issue where emoji in a chat history might cause issues when saving/loading the kani state
- (OpenAI) Fixes an issue where the `content` field might get omitted in certain requests, causing an API error

0.6.1

- Internal changes to the OpenAIEngine to make extending it easier
- No consumer-facing changes

Page 3 of 6

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.