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

Updating feat/llm_responses to v1.0.0rc1 #390

Merged
merged 12 commits into from
Sep 18, 2024
Merged

Conversation

NotBioWaste905
Copy link
Collaborator

Description

Keeping up with the v1.0.0 release.

pseusys and others added 12 commits July 5, 2024 10:52
Pepy markdown badge was outdated. Now it is updated once again.
# Description

## Breaking Changes

- All conditions (standard and slot) moved to `chatsky.conditions`
- All labels (standard) moved to `chatsky.destinations`
- All processing functions (slot) moved to `chatsky.processing`
- All responses (standard and slot) moved to `chatsky.responses`
- All conditions, destinations, processing functions, responses are now
upper camel case
- `script.core` module moved to `chatsky.core`
- `Pipeline` moved to `chatsky.core`
- `pipeline.service` submodule moved to `chatsky.core.service`
- 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
- 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`.
- Removed `lbl.repeat` renamed to `dst.Current`. Added `dst.FromHistory`
to get labels from history past `dst.Previous`.
- Custom script functions now have to be subclassed from
`BaseScriptFunction`.
e.g. custom response function now have to be subclassed from
`BaseResponse`.
- All keywords from `chatsky.script.core.keywords` moved to
`chatsky.core.script`
- `PRE_TRANSITIONS_PROCESSING` renamed to `PRE_TRANSITION`
- `PRE_RESPONSE_PROCESSING` renamed to `PRE_RESPONSE`
- Removed `chatsky.utils.turn_caching`
- 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

## Features 

- `RESPONSE` can now be a string. It will be converted to
`Message(text=)` automatically
- Custom functions do validation (e.g. response function can now return
a string and it will be cast to `Message`)
- Current instance of `Pipeline` can now be accessed via
`Context.pipeline`
- Added `NodeLabel` class to replace tuple node labels
- The order of global/local transition inheritance for
`ctx.current_node` is now reversed
  (`[*node, *local, *global]` instead of `[*global, *local, *node]`)
  to reflect the inheritance priority order (node>local>global)
- Added method `Script.get_inherited_node` to get a node that inherits
global and local properties.
  `ctx.current_node` is obtained via this method
- 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.

## Fixes

- Slot template filling now works for numerical slot names (e.g.
`slot_name="0"`)
- Slot Groups can now be initialized from a dictionary
- Exceptions in user functions are now properly handled:
  - response errors result in an empty message
  - processing errors are ignored
  - transition errors mark that specific transition as failed

## Documentation

- Some improvements to basic conceptions user guide and global tutorial
- Added a tip on getting previous nodes to pre transition tutorial
- Removed `responses.1_basics` tutorial
- Slight improvements to web api interface tutorials

## Devel

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

Added option to initialize Pipeline from yaml/json files.

## Changelog

### Breaking changes

- Removed `proc.ExtractAll` -- the function is unsafe as it overwrites
the entire slot storage. it is still available as method of the slot
manager

### Features

- Add Pipeline from file import
- Add function that creates an index of commonly-used Chatsky objects
- Added imports to some `__init__` files
- Allow initializing NodeLabel from a list of two strings

### Bug fixes

- 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

### Devel
- Add aliases to script keywords

# Checklist

- [x] I have performed a self-review of the changes

# To Consider

- Add tests (if functionality is changed)
- Update API reference / tutorials / guides
- Update CONTRIBUTING.md (if devel workflow is changed)
- Update `.ignore` files, scripts (such as `lint`), distribution
manifest (if files are added/deleted)
- Search for references to changed entities in the codebase

---------

Co-authored-by: Ramimashkouk <[email protected]>
Co-authored-by: Ramimashkouk <[email protected]>
# Description

Now dictionaries are merged in a way that localized processing functions
are called first.
(node > local > global)

# Checklist

- [x] I have performed a self-review of the changes

*List here tasks to complete in order to mark this PR as ready for
review.*

# To Consider

- Add tests (if functionality is changed)
- Update API reference / tutorials / guides
- Update CONTRIBUTING.md (if devel workflow is changed)
- Update `.ignore` files, scripts (such as `lint`), distribution
manifest (if files are added/deleted)
- Search for references to changed entities in the codebase
@NotBioWaste905 NotBioWaste905 merged commit 0139421 into feat/llm_responses Sep 18, 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.

3 participants