Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release v0.9 #393

Merged
merged 6 commits into from
Sep 27, 2024
Merged

Release v0.9 #393

merged 6 commits into from
Sep 27, 2024

Conversation

RLKRo
Copy link
Member

@RLKRo RLKRo commented Sep 27, 2024

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 (Pydantic improvements #372)
  • All conditions (standard and slot) moved to chatsky.conditions (Feat/core rework #381)
  • All labels (standard) moved to chatsky.destinations (Feat/core rework #381)
  • All processing functions (slot) moved to chatsky.processing (Feat/core rework #381)
  • All responses (standard and slot) moved to chatsky.responses (Feat/core rework #381)
  • All conditions, destinations, processing functions, responses are now upper camel case (Feat/core rework #381)
  • script.core module moved to chatsky.core (Feat/core rework #381)
  • Pipeline moved to chatsky.core (Feat/core rework #381)
  • pipeline.service submodule moved to chatsky.core.service (Feat/core rework #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 (Feat/core rework #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. (Feat/core rework #381)
  • Removed lbl.repeat renamed to dst.Current. Added dst.FromHistory to get labels from history past dst.Previous. (Feat/core rework #381)
  • Custom script functions now have to be subclassed from BaseScriptFunction.
    e.g. custom response function now have to be subclassed from BaseResponse. (Feat/core rework #381)
  • All keywords from chatsky.script.core.keywords moved to chatsky.core.script (Feat/core rework #381)
  • PRE_TRANSITIONS_PROCESSING renamed to PRE_TRANSITION (Feat/core rework #381)
  • PRE_RESPONSE_PROCESSING renamed to PRE_RESPONSE (Feat/core rework #381)
  • Removed chatsky.utils.turn_caching (Feat/core rework #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 (Feat/core rework #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 (Feat/script parser #385)
  • The order of execution for pre-transition, pre-response processing is reversed: global processings will be the last ones. (fix node merge #387)
  • Service changes: (Service option update #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 (Feat/core rework #381)
  • Custom functions do validation (e.g. response function can now return a string and it will be cast to Message) (Feat/core rework #381)
  • Current instance of Pipeline can now be accessed via Context.pipeline (Feat/core rework #381)
  • Added NodeLabel class to replace tuple node labels (Feat/core rework #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 (Feat/core rework #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. (Feat/core rework #381)
  • Added ModifyResponse base processing class which allows modifying current node response. (Feat/core rework #381)
  • Added Pipeline from file import (Feat/script parser #385)
  • Added function that creates an index of commonly-used Chatsky objects (Feat/script parser #385)
  • ServiceFinished condition now has an option to wait for the specified component to complete; Service states are now initialized before services are executed (Service option update #378)

Fixes

  • Slot template filling now works for numerical slot names (e.g. slot_name="0") (Feat/core rework #381)
  • Slot Groups can now be initialized from a dictionary (Feat/core rework #381)
  • Exceptions in user functions are now properly handled: (Feat/core rework #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 (Feat/script parser #385)
  • Service component timeout is now always applied (Service option update #378)
  • Unsuccessful stat extraction no longer fails the component (Service option update #378)

Documentation

Devel

RLKRo and others added 4 commits September 25, 2024 18:31
* Move callback transitions to local node
* Fix markdown parse mode for hash message
* Expand documentation on extra fields
# Description

## Breaking Changes

- Service changes:
  - 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

- `ServiceFinished` condition now has an option to wait for the specified component to complete; Service states are now initialized before services are executed

## Documentation

- Pipeline tutorials renamed to service tutorials and rewritten for more clarity

## Fixes

- Service component timeout is now always applied
- Unsuccessful stat extraction no longer fails the component

## Devel

- `FrameworkData.service_states` now contains objects of a new class `ServiceState`
- Added support for non-function callables for `wrap_sync_function_in_async`

---------

Co-authored-by: Roman Zlobin <[email protected]>
Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It appears this PR is a release PR (change its base from master if that is not the case).

Here's a release checklist:

  • Update package version
  • Update poetry.lock
  • Change PR merge option
  • Update template repo
  • Search for objects to be deprecated
  • Test parts not covered with pytest:
    • web_api tutorials
    • Test integrations with external services (telegram; stats)

@RLKRo RLKRo merged commit 8ea8c7a into master Sep 27, 2024
17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants