Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
Pipeline.from_script
. Use__init__
instead (Pydantic improvements #372)chatsky.conditions
(Feat/core rework #381)chatsky.destinations
(Feat/core rework #381)chatsky.processing
(Feat/core rework #381)chatsky.responses
(Feat/core rework #381)script.core
module moved tochatsky.core
(Feat/core rework #381)Pipeline
moved tochatsky.core
(Feat/core rework #381)pipeline.service
submodule moved tochatsky.core.service
(Feat/core rework #381)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)
cnd.true
andcnd.false
. Condition field ofTransition
now acceptsTrue
andFalse
literals.If condition field of
Transition
is not set, it defaults toTrue
. (Feat/core rework #381)lbl.repeat
renamed todst.Current
. Addeddst.FromHistory
to get labels from history pastdst.Previous
. (Feat/core rework #381)BaseScriptFunction
.e.g. custom response function now have to be subclassed from
BaseResponse
. (Feat/core rework #381)chatsky.script.core.keywords
moved tochatsky.core.script
(Feat/core rework #381)PRE_TRANSITIONS_PROCESSING
renamed toPRE_TRANSITION
(Feat/core rework #381)PRE_RESPONSE_PROCESSING
renamed toPRE_RESPONSE
(Feat/core rework #381)chatsky.utils.turn_caching
(Feat/core rework #381)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)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)optimization_warnings
option -- not necessary with the service changesPipeline.add_global_handler
-- usePipeline.services_pipeline.add_extra_handler
insteadconcurrent
flag for componentspipeline
from component and extra handler arguments. Usectx.pipeline
insteadBaseCondition
instead of functionsGlobalExtraHandlerType
:add_extra_handler
acceptsExtraHandlerType
insteadService
can be subclassed allowing access to its fieldsfunc
andcomponent
is the instance of the componentFeatures
RESPONSE
can now be a string. It will be converted toMessage(text=)
automatically (Feat/core rework #381)Message
) (Feat/core rework #381)Pipeline
can now be accessed viaContext.pipeline
(Feat/core rework #381)NodeLabel
class to replace tuple node labels (Feat/core rework #381)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)check_happy_path
to response_comparator, removed default comparators, removed context from signature;messages in
happy_path
can now be any ofMessage
,dict
,str
;printout_enable
flag renamed toprintout
and madeFalse
by default. (Feat/core rework #381)ModifyResponse
base processing class which allows modifying current node response. (Feat/core rework #381)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_name="0"
) (Feat/core rework #381)success_only
flag (Feat/script parser #385)Documentation
responses.1_basics
tutorial (Feat/core rework #381)Devel
Pipeline
and all its components are nowBaseModel
s (Pydantic improvements #372)log_event_catcher
fixture to help test captured logs (Feat/core rework #381)TYPE_CHECKING
exclude from coverage; now only certain exception raises are excluded from coverage (Feat/core rework #381)run_interactive_mode
. Just usepipeline.run()
. (Feat/core rework #381)InitTypes
for various BaseModels to indicate types that can be validated into that model (Feat/core rework #381)Actor
now doesn't have any parameters (Feat/core rework #381)normalization
utils replaced with pydantic validators (Feat/core rework #381)Script
can now be validated from a script dict (without thescript
field) (Feat/core rework #381)Context.cast
. Usemodel_validate
andmodel_validate_json
instead. (Feat/core rework #381)FrameworkData.service_states
now contains objects of a new classServiceState
(Service option update #378)wrap_sync_function_in_async
(Service option update #378)