Chatsky

Latest version: v0.9.0

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

Scan your dependencies

Page 1 of 4

1.0.0rc1

Changelog

This release includes a huge rework of core library features.

It is highly recommended to reread documentation relating to scripting.
(basic concepts user guide; script and pipeline tutorials)

Breaking Changes

- Removed `Pipeline.from_script`. Use `__init__` instead (372)
- All conditions (standard and slot) moved to `chatsky.conditions` (381)
- All labels (standard) moved to `chatsky.destinations` (381)
- All processing functions (slot) moved to `chatsky.processing` (381)
- All responses (standard and slot) moved to `chatsky.responses` (381)
- All conditions, destinations, processing functions, responses are now upper camel case (381)
- `script.core` module moved to `chatsky.core` (381)
- `Pipeline` moved to `chatsky.core` (381)
- `pipeline.service` submodule moved to `chatsky.core.service` (381)
- Added class `Transition`. `TRANSITIONS` is now a list of such objects instead of a dict.
Destination, condition and priority are all fields of this class. Priority is now separate from node label (381)
- Removed `cnd.true` and `cnd.false`. Condition field of `Transition` now accepts `True` and `False` literals.
If condition field of `Transition` is not set, it defaults to `True`. (381)
- Removed `lbl.repeat` renamed to `dst.Current`. Added `dst.FromHistory` to get labels from history past `dst.Previous`. (381)
- Custom script functions now have to be subclassed from `BaseScriptFunction`.
e.g. custom response function now have to be subclassed from `BaseResponse`. (381)
- All keywords from `chatsky.script.core.keywords` moved to `chatsky.core.script` (381)
- `PRE_TRANSITIONS_PROCESSING` renamed to `PRE_TRANSITION` (381)
- `PRE_RESPONSE_PROCESSING` renamed to `PRE_RESPONSE` (381)
- Removed `chatsky.utils.turn_caching` (381)
- Turn id `0` is now reserved for start label. Actual turns start at id 1.
Context has method `init` to init from a start label (381)
- Removed `proc.ExtractAll` -- the function is unsafe as it overwrites the entire slot storage. it is still available as method of the slot manager (385)
- The order of execution for pre-transition, pre-response processing is reversed: global processings will be the last ones. (387)

Features

- `RESPONSE` can now be a string. It will be converted to `Message(text=)` automatically (381)
- Custom functions do validation (e.g. response function can now return a string and it will be cast to `Message`) (381)
- Current instance of `Pipeline` can now be accessed via `Context.pipeline` (381)
- Added `NodeLabel` class to replace tuple node labels (381)
- Added method `Script.get_inherited_node` to get a node that inherits global and local properties.
`ctx.current_node` is obtained via this method (381)
- Renamed response_comparer of `check_happy_path` to response_comparator, removed default comparators, removed context from signature;
messages in `happy_path` can now be any of `Message`, `dict`, `str`;
`printout_enable` flag renamed to `printout` and made `False` by default. (381)
- Added `ModifyResponse` base processing class which allows modifying current node response. (381)
- Added Pipeline from file import (385)
- Added function that creates an index of commonly-used Chatsky objects (385)

Fixes

- Slot template filling now works for numerical slot names (e.g. `slot_name="0"`) (381)
- Slot Groups can now be initialized from a dictionary (381)
- Exceptions in user functions are now properly handled: (381)
- response errors result in an empty message
- processing errors are ignored
- transition errors mark that specific transition as failed
- Slot extraction will now not write the value to the slot storage if value was not successfully extracted. Can be changed via the `success_only` flag (385)

Documentation

- Some improvements to basic conceptions user guide and global tutorial (381)
- Added a tip on getting previous nodes to pre transition tutorial (381)
- Removed `responses.1_basics` tutorial (381)
- Updated copyright year (a7df04a34c2dfde88e2220d29d904ab892c8d3bb)
- Updated logos (8649446eca13c82f6ea7f598169e35ec54d09e9c)

Devel

- `Pipeline` and all its components are now `BaseModel`s (372)
- Added `log_event_catcher` fixture to help test captured logs (381)
- Added `TYPE_CHECKING` exclude from coverage; now only certain exception raises are excluded from coverage (381)
- Removed `run_interactive_mode`. Just use `pipeline.run()`. (381)
- Removed Annotated values with pickle serializer/validators. Better to use field_validators/field_serializers to preserve model schema (381)
- Added `InitTypes` for various BaseModels to indicate types that can be validated into that model (381)
- `Actor` now doesn't have any parameters (381)
- `normalization` utils replaced with pydantic validators (381)
- An instance of `Script` can now be validated from a script dict (without the `script` field) (381)
- Removed `Context.cast`. Use `model_validate` and `model_validate_json` instead. (381)
- Added aliases to script keywords (385)

0.9.0

Changelog

This release includes a huge rework of core library features.

It is highly recommended to reread documentation relating to scripting.
(basic concepts user guide; script and pipeline (now service) tutorials)

Changes in bold indicate new changes compared to the previous pre-release (v1.0.0rc1).

Breaking Changes

- Removed `Pipeline.from_script`. Use `__init__` instead (372)
- All conditions (standard and slot) moved to `chatsky.conditions` (381)
- All labels (standard) moved to `chatsky.destinations` (381)
- All processing functions (slot) moved to `chatsky.processing` (381)
- All responses (standard and slot) moved to `chatsky.responses` (381)
- All conditions, destinations, processing functions, responses are now upper camel case (381)
- `script.core` module moved to `chatsky.core` (381)
- `Pipeline` moved to `chatsky.core` (381)
- `pipeline.service` submodule moved to `chatsky.core.service` (381)
- Added class `Transition`. `TRANSITIONS` is now a list of such objects instead of a dict.
Destination, condition and priority are all fields of this class. Priority is now separate from node label (381)
- Removed `cnd.true` and `cnd.false`. Condition field of `Transition` now accepts `True` and `False` literals.
If condition field of `Transition` is not set, it defaults to `True`. (381)
- Removed `lbl.repeat` renamed to `dst.Current`. Added `dst.FromHistory` to get labels from history past `dst.Previous`. (381)
- Custom script functions now have to be subclassed from `BaseScriptFunction`.
e.g. custom response function now have to be subclassed from `BaseResponse`. (381)
- All keywords from `chatsky.script.core.keywords` moved to `chatsky.core.script` (381)
- `PRE_TRANSITIONS_PROCESSING` renamed to `PRE_TRANSITION` (381)
- `PRE_RESPONSE_PROCESSING` renamed to `PRE_RESPONSE` (381)
- Removed `chatsky.utils.turn_caching` (381)
- Turn id `0` is now reserved for start label. Actual turns start at id 1.
Context has method `init` to init from a start label (381)
- Removed `proc.ExtractAll` -- the function is unsafe as it overwrites the entire slot storage. it is still available as method of the slot manager (385)
- The order of execution for pre-transition, pre-response processing is reversed: global processings will be the last ones. (387)
- **Service changes: (378)**
- Pipeline no longer has `optimization_warnings` option -- not necessary with the service changes
- Pipeline service group now has an empty name
- Removed `Pipeline.add_global_handler` -- use `Pipeline.services_pipeline.add_extra_handler` instead
- Replaced async flags with `concurrent` flag for components
- Removed `pipeline` from component and extra handler arguments. Use `ctx.pipeline` instead
- Component start condition now accepts `BaseCondition` instead of functions
- Changed the logic behind giving names to components with no name
- Removed `GlobalExtraHandlerType`: `add_extra_handler` accepts `ExtraHandlerType` instead
- Removed ServiceRuntimeInfo: now `Service` can be subclassed allowing access to its fields
- Extra handler runtime info now does not contain `func` and `component` is the instance of the component

Features

- `RESPONSE` can now be a string. It will be converted to `Message(text=)` automatically (381)
- Custom functions do validation (e.g. response function can now return a string and it will be cast to `Message`) (381)
- Current instance of `Pipeline` can now be accessed via `Context.pipeline` (381)
- Added `NodeLabel` class to replace tuple node labels (381)
- Added method `Script.get_inherited_node` to get a node that inherits global and local properties.
`ctx.current_node` is obtained via this method (381)
- Renamed response_comparer of `check_happy_path` to response_comparator, removed default comparators, removed context from signature;
messages in `happy_path` can now be any of `Message`, `dict`, `str`;
`printout_enable` flag renamed to `printout` and made `False` by default. (381)
- Added `ModifyResponse` base processing class which allows modifying current node response. (381)
- Added Pipeline from file import (385)
- Added function that creates an index of commonly-used Chatsky objects (385)
- **`ServiceFinished` condition now has an option to wait for the specified component to complete; Service states are now initialized before services are executed (378)**

Fixes

- Slot template filling now works for numerical slot names (e.g. `slot_name="0"`) (381)
- Slot Groups can now be initialized from a dictionary (381)
- Exceptions in user functions are now properly handled: (381)
- response errors result in an empty message
- processing errors are ignored
- transition errors mark that specific transition as failed
- Slot extraction will now not write the value to the slot storage if value was not successfully extracted. Can be changed via the `success_only` flag (385)
- **Service component timeout is now always applied (378)**
- **Unsuccessful stat extraction no longer fails the component (378)**

Documentation

- **Pipeline tutorials renamed to service tutorials and rewritten for more clarity (378)**
- Some improvements to basic conceptions user guide and global tutorial (381)
- Added a tip on getting previous nodes to pre transition tutorial (381)
- Removed `responses.1_basics` tutorial (381)
- Updated copyright year (a7df04a34c2dfde88e2220d29d904ab892c8d3bb)
- Updated logos (8649446eca13c82f6ea7f598169e35ec54d09e9c)

Devel

- `Pipeline` and all its components are now `BaseModel`s (372)
- Added `log_event_catcher` fixture to help test captured logs (381)
- Added `TYPE_CHECKING` exclude from coverage; now only certain exception raises are excluded from coverage (381)
- Removed `run_interactive_mode`. Just use `pipeline.run()`. (381)
- Removed Annotated values with pickle serializer/validators. Better to use field_validators/field_serializers to preserve model schema (381)
- Added `InitTypes` for various BaseModels to indicate types that can be validated into that model (381)
- `Actor` now doesn't have any parameters (381)
- `normalization` utils replaced with pydantic validators (381)
- An instance of `Script` can now be validated from a script dict (without the `script` field) (381)
- Removed `Context.cast`. Use `model_validate` and `model_validate_json` instead. (381)
- Added aliases to script keywords (385)
- **`FrameworkData.service_states` now contains objects of a new class `ServiceState` (378)**
- **Added support for non-function callables for `wrap_sync_function_in_async` (378)**

0.8.0

Changelog

General

- Framework renamed from DFF to Chatsky (368)

Features

- New `has_text` condition for asserting that specific text is contained inside the last request (335)
- Validation stage reworked.
`Pipeline.validation_stage`, `Pipeline.verbose` and `Context.validation` fields are removed.
Added new type for annotating labels `dff.script.ConstLabel` (289)
- Functions `cnd.exact_match` and `check_happy_path` now accept both `Message` and `str`.
The following are now equivalent: `exact_match(Message("text"))` == `exact_match("text")`
(337)
- CLIMessengerInterface moved to `messengers.console` (328)
- Attachments reworked (328):
- `Session`, `Command`, `Link`, `Button`, `Keyboard` and `Attachments` classes removed, `Message.commands` field removed.
- Added `CallbackQuery`, `Contact`, `Invoice`, `Poll`, `Animation`, `Sticker`, `VoiceMessage`, `VideoMessage` and `MediaGroup` classes.
- Added attachment caching feature.
- Added `has_callback_query` condition.
- Removed `title` field from Data Attachments. Use `caption` instead.
- Telegram Messenger interface reworked (328):
- Now provides methods for attachment byte download.
- Added support for receiving attachment types as members of `Message.attachments`. Others may be accessed via `Message.original_message`.
- Added support for sending new attachment types (`Sticker`, `Poll`, e.t.c.).
- Added support for extra options such as `disable_notification`, `message_effect_id` or `caption`.
- Telegram tutorials rewritten to reflect all the changes.
- Added slots that simplify the process of extracting arbitrary data from user messages and accessing it later (36):
- New user guide and tutorials on slots

Documentation

- Return PRE_RESPONSE_PROCESSING and PRE_TRANSITION_PROCESSING tutorials
- New telegram interface tutorials (328)
- Slots user guide and tutorials (36)

Contrib

- Added `poe quick_test` to run tests that are not slow and do not require docker (344)
- `Context.framework_states` renamed to `Context.framework_data` and made `Pydantic.BaseModel` (359)
- Added `MessengerInterfaceWithAttachments` class (328)
- Added tools for enabling json serialization via pickle (328)
- Telegram tests made independent from telegram servers (328)
- `wrap_sync_function_in_async` moved to `utils.devel` (36)

0.7.2

Fixes 391 -- pyTelegramBotAPI update

0.7.0

Release Notes

Deprecations
- Remove `MultiMessage` 330. See the corresponding tutorial for an alternative.
- Validation Stage now does not run user functions 331. It is no longer necessary to use `ctx.validation`.
- Tutorials for `PRE_TRANSITION_PROCESSING` and `PRE_RESPONSE_PROCESSING` are removed 08672c0f8f72d99205ac42a030a38389fdf762ed. ~~The support for these keywords will be removed in a later release.~~

Improvements
- Update user function signatures (allow any such function to be async; remove `*args, **kwargs`; `Context` is no longer supported as a return argument, modify it in-place instead) 253
- Add more info for the README file 294 295
- Allow initializing `Message` class without specifying the first argument as `text` (e.g. `Message("Hi")`) 327
- More verbose exception logging e968fd0c0fda0b9cb04ebf09a7ebf13054543c30
- Switch to poetry 132. `CONTRIBUTING.md` has been updated to reflect the changes in our workflow.
- Pipeline typing improvements 310

0.6.5

Fixes 391 -- pyTelegramBotAPI update

Page 1 of 4

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.