Kani

Latest version: v1.2.4

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

Scan your dependencies

Page 1 of 6

1.2.4

- Pin the Pydantic dependency to `pydantic<2.10.0` as this version breaks JSON schema generation and MessagePart serialization

1.2.3

- Fixes Anthropic tool calling being broken with anthropic-sdk>0.26.0
- Fixes an issue where Anthropic prompts were over-eagerly trimming prompts that did not start with a user message
- Added support for tool calling while streaming with Anthropic models

1.2.2

- fix(mistral): ensure prompt and completion tokens are passed through in the MistralFunctionCallingAdapter when streaming
- fix(streaming): don't emit text in DummyStream if it is None
- feat: add standalone width formatters
- docs: gpt-3.5-turbo -> gpt-4o-mini defaults
- fix(streaming): potential line len miscount in format_stream

1.2.1

- Fixes various issues in the `MistralFunctionCallingAdapter` wrapper engine for Mistral-Large and Mistral-Small function calling models.
- Fixes an issue in `PromptPipeline.explain()` where manual examples would not be explained.
- Fixes an issue in `PromptPipeline.ensure_bound_function_calls()` where passing an ID translator would mutate the ID of the underlying messages

1.2.0

New Features
- Hugging Face: Models loaded through the `HuggingEngine` now use [chat templates](https://huggingface.co/docs/transformers/main/chat_templating) for conversational prompting and tool usage if available by default. This should make it much easier to get started with a Hugging Face model in Kani.
- Added the ability to supply a custom tokenizer to the `OpenAIEngine` (e.g., for using OpenAI-compatible APIs)\

Fixes/Improvements
- Fixed a missing dependency in the `llama` extra
- The `HuggingEngine` will now automatically set `device_map="auto"` if the `accelerate` library is installed

1.1.1

- Fixes an issue where `PromptPipeline.ensure_bound_function_calls()` could still let unbound function calls through in cases of particularly long prompts with prefixing system prompts

Page 1 of 6

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.