Releases: deeppavlov/chatsky
Releases · deeppavlov/chatsky
Release v0.10.0
Changelog
Breaking Changes
- Dropped support for python 3.8; added support for python 3.12 (#400);
- Reworked DB architecture to support partials turn reads/writes (#93).
Old Context storages are incompatible with the new ones.
See tutorial Context Storages: 8 for more info; Context.labels,Context.requests,Context.responsesare now only
lazily loaded (#93).
Items from older turns can be loaded on demand.
Their__getitem__andgetmethods are now async.
Features
- Added
LLMResponseandLLMConditionclasses that allow using LLMs
(#376).
See the new LLM Integration tutorials and LLM user guide for more info; - Added option to extract group slots partially (#394).
See tutorial Slots: 2 for more information; Message.original_messageis replaced withMessage.originwhich
stores both
the original message and the interface from which the message originated
(#398);- Added
Context.current_turn_idfield which stores the number of the
current turn (#93); - Added
Context.created_at,Context.updated_attimestamp fields
(#93); - Added
Context.turnsproperty which allows iterating over
requests/labels/responses by their turn ids (#93); Context.labels,Context.requests,Context.responsesnow support
slicing (#93).
__getitem__,__setitem__and__delitem__methods can now accept
slices of turn ids in addition to single turn id.
getmethod can now accepts iterable of turn ids in addition to single
turn id.
Documentation
- Documentation is now versioned (#346, #409).
You can select preferred version via the drop-down menu in the top-right
corner.
Developer changes
- Context now has field
origin_interfaceto store name of the
interface that created it (#398); - Added script
docs_no_dockerfor building documentation without
docker (ef11ff9); - Added in-RAM context storage to be the default one instead of a plain
dict (#93); - Removed methods
Context.add_request,Context.add_labeland
Context.add_response(#93).
Use setters withContext.current_turn_idinstead.
v0.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.coremodule moved tochatsky.core(#381)Pipelinemoved tochatsky.core(#381)pipeline.servicesubmodule moved tochatsky.core.service(#381)- Added class
Transition.TRANSITIONSis 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.trueandcnd.false. Condition field ofTransitionnow acceptsTrueandFalseliterals.
If condition field ofTransitionis not set, it defaults toTrue. (#381) - Removed
lbl.repeatrenamed todst.Current. Addeddst.FromHistoryto get labels from history pastdst.Previous. (#381) - Custom script functions now have to be subclassed from
BaseScriptFunction.
e.g. custom response function now have to be subclassed fromBaseResponse. (#381) - All keywords from
chatsky.script.core.keywordsmoved tochatsky.core.script(#381) PRE_TRANSITIONS_PROCESSINGrenamed toPRE_TRANSITION(#381)PRE_RESPONSE_PROCESSINGrenamed toPRE_RESPONSE(#381)- Removed
chatsky.utils.turn_caching(#381) - Turn id
0is now reserved for start label. Actual turns start at id 1.
Context has methodinitto 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_warningsoption -- not necessary with the service changes - Pipeline service group now has an empty name
- Removed
Pipeline.add_global_handler-- usePipeline.services_pipeline.add_extra_handlerinstead - Replaced async flags with
concurrentflag for components - Removed
pipelinefrom component and extra handler arguments. Usectx.pipelineinstead - Component start condition now accepts
BaseConditioninstead of functions - Changed the logic behind giving names to components with no name
- Removed
GlobalExtraHandlerType:add_extra_handleracceptsExtraHandlerTypeinstead - Removed ServiceRuntimeInfo: now
Servicecan be subclassed allowing access to its fields - Extra handler runtime info now does not contain
funcandcomponentis the instance of the component
- Pipeline no longer has
Features
RESPONSEcan now be a string. It will be converted toMessage(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
Pipelinecan now be accessed viaContext.pipeline(#381) - Added
NodeLabelclass to replace tuple node labels (#381) - Added method
Script.get_inherited_nodeto get a node that inherits global and local properties.
ctx.current_nodeis obtained via this method (#381) - Renamed response_comparer of
check_happy_pathto response_comparator, removed default comparators, removed context from signature;
messages inhappy_pathcan now be any ofMessage,dict,str;
printout_enableflag renamed toprintoutand madeFalseby default. (#381) - Added
ModifyResponsebase 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)
ServiceFinishedcondition 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_onlyflag (#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_basicstutorial (#381) - Updated copyright year (a7df04a)
- Updated logos (8649446)
Devel
Pipelineand all its components are nowBaseModels (#372)- Added
log_event_catcherfixture to help test captured logs (#381) - Added
TYPE_CHECKINGexclude from coverage; now only certain exception raises are excluded from coverage (#381) - Removed
run_interactive_mode. Just usepipeline.run(). (#381) - Removed Annotated values with pickle serializer/validators. Better to use field_validators/field_serializers to preserve model schema (#381)
- Added
InitTypesfor various BaseModels to indicate types that can be validated into that model (#381) Actornow doesn't have any parameters (#381)normalizationutils replaced with pydantic validators (#381)- An instance of
Scriptcan now be validated from a script dict (without thescriptfield) (#381) - Removed
Context.cast. Usemodel_validateandmodel_validate_jsoninstead. (#381) - Added aliases to script keywords (#385)
FrameworkData.service_statesnow contains objects of a new classServiceState(#378)- Added support for non-function callables for
wrap_sync_function_in_async(#378)
v0.7.2
v0.6.5
v1.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.coremodule moved tochatsky.core(#381)Pipelinemoved tochatsky.core(#381)pipeline.servicesubmodule moved tochatsky.core.service(#381)- Added class
Transition.TRANSITIONSis 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.trueandcnd.false. Condition field ofTransitionnow acceptsTrueandFalseliterals.
If condition field ofTransitionis not set, it defaults toTrue. (#381) - Removed
lbl.repeatrenamed todst.Current. Addeddst.FromHistoryto get labels from history pastdst.Previous. (#381) - Custom script functions now have to be subclassed from
BaseScriptFunction.
e.g. custom response function now have to be subclassed fromBaseResponse. (#381) - All keywords from
chatsky.script.core.keywordsmoved tochatsky.core.script(#381) PRE_TRANSITIONS_PROCESSINGrenamed toPRE_TRANSITION(#381)PRE_RESPONSE_PROCESSINGrenamed toPRE_RESPONSE(#381)- Removed
chatsky.utils.turn_caching(#381) - Turn id
0is now reserved for start label. Actual turns start at id 1.
Context has methodinitto 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
RESPONSEcan now be a string. It will be converted toMessage(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
Pipelinecan now be accessed viaContext.pipeline(#381) - Added
NodeLabelclass to replace tuple node labels (#381) - Added method
Script.get_inherited_nodeto get a node that inherits global and local properties.
ctx.current_nodeis obtained via this method (#381) - Renamed response_comparer of
check_happy_pathto response_comparator, removed default comparators, removed context from signature;
messages inhappy_pathcan now be any ofMessage,dict,str;
printout_enableflag renamed toprintoutand madeFalseby default. (#381) - Added
ModifyResponsebase 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_onlyflag (#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_basicstutorial (#381) - Updated copyright year (a7df04a)
- Updated logos (8649446)
Devel
Pipelineand all its components are nowBaseModels (#372)- Added
log_event_catcherfixture to help test captured logs (#381) - Added
TYPE_CHECKINGexclude from coverage; now only certain exception raises are excluded from coverage (#381) - Removed
run_interactive_mode. Just usepipeline.run(). (#381) - Removed Annotated values with pickle serializer/validators. Better to use field_validators/field_serializers to preserve model schema (#381)
- Added
InitTypesfor various BaseModels to indicate types that can be validated into that model (#381) Actornow doesn't have any parameters (#381)normalizationutils replaced with pydantic validators (#381)- An instance of
Scriptcan now be validated from a script dict (without thescriptfield) (#381) - Removed
Context.cast. Usemodel_validateandmodel_validate_jsoninstead. (#381) - Added aliases to script keywords (#385)
Chatsky release
Changelog
General
- Framework renamed from DFF to Chatsky (#368)
Features
- New
has_textcondition for asserting that specific text is contained inside the last request (#335) - Validation stage reworked.
Pipeline.validation_stage,Pipeline.verboseandContext.validationfields are removed.
Added new type for annotating labelsdff.script.ConstLabel(#289) - Functions
cnd.exact_matchandcheck_happy_pathnow accept bothMessageandstr.
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,KeyboardandAttachmentsclasses removed,Message.commandsfield removed.- Added
CallbackQuery,Contact,Invoice,Poll,Animation,Sticker,VoiceMessage,VideoMessageandMediaGroupclasses. - Added attachment caching feature.
- Added
has_callback_querycondition. - Removed
titlefield from Data Attachments. Usecaptioninstead.
- 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 viaMessage.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_idorcaption. - 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_testto run tests that are not slow and do not require docker (#344) Context.framework_statesrenamed toContext.framework_dataand madePydantic.BaseModel(#359)- Added
MessengerInterfaceWithAttachmentsclass (#328) - Added tools for enabling json serialization via pickle (#328)
- Telegram tests made independent from telegram servers (#328)
wrap_sync_function_in_asyncmoved toutils.devel(#36)
Script Parser (DEV RELEASE)
v0.6.4.dev0 prepare parser for dev release
Release v0.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_PROCESSINGandPRE_RESPONSE_PROCESSINGare removed 08672c0.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;Contextis no longer supported as a return argument, modify it in-place instead) #253 - Add more info for the README file #294 #295
- Allow initializing
Messageclass without specifying the first argument astext(e.g.Message("Hi")) #327 - More verbose exception logging e968fd0
- Switch to poetry #132.
CONTRIBUTING.mdhas been updated to reflect the changes in our workflow. - Pipeline typing improvements #310
Release v0.6.4
Release Notes
Release v0.6.3
Release notes
- Update README to make it more concise and include reasons to use DFF (#281)
- Add DFF optimization guide (#236)
- Add documentation section description for the index page (#281)
- Add async method dff.messengers.common.interface.CallbackMessengerInterface.on_request_async (#206)
- Move information about messenger interfaces from
pipeline.6_custom_messenger_interface(removed) to messengers.web_api_interface.1_fastapi (#206) - Fix cross-references in dff.messengers.common.interface (#206)
- Update tutorials to fit into documentation without side-scrolling (#241)