Closed RLKRo closed 2 months ago
Short review:
run
with cli_run
linkCurrent
doesn't seem quite right, alternatives (This, Self, LoopBack)? linkcnd
and dst
, so instead of Tr(dst="intro_node", cnd=cnd.ExactMatch("/start"))
, do Tr(cnd=cnd.ExactMatch("/start"), dst="intro_node")
text
from the mandatory named arguments in Message
Pipeline
is already in ctx
, it’s better to use Pipeline
from ctx
rather than passing it as a service argument, herecnd
should always be a function; it's better to stick to this convention, hererun
is a method that runs it with the set interface. When using telegram interface pipeline.run
is used as well. I could add comments explaining that pipeline.run
starts up its interface which is CLI by default.dst.This
. The only problem is that it would make less sense for LOCAL
and GLOBAL
than Current
.text
as a first positional argument, that has been re-added here.Transition.cnd
should never be a literal True
or False
? I don't see a reason to forbid this, but it is needed to have True
by default.BaseProcessing
that hides these parts making it easy to define a Processing that modifies response. I can implement that earlier and insert into the tutorial.
Description
Breaking Changes
chatsky.conditions
chatsky.destinations
chatsky.processing
chatsky.responses
script.core
module moved tochatsky.core
Pipeline
moved tochatsky.core
pipeline.service
submodule moved tochatsky.core.service
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 labelcnd.true
andcnd.false
. Condition field ofTransition
now acceptsTrue
andFalse
literals. If condition field ofTransition
is not set, it defaults toTrue
.lbl.repeat
renamed todst.Current
. Addeddst.FromHistory
to get labels from history pastdst.Previous
.BaseScriptFunction
. e.g. custom response function now have to be subclassed fromBaseResponse
.chatsky.script.core.keywords
moved tochatsky.core.script
PRE_TRANSITIONS_PROCESSING
renamed toPRE_TRANSITION
PRE_RESPONSE_PROCESSING
renamed toPRE_RESPONSE
chatsky.utils.turn_caching
0
is now reserved for start label. Actual turns start at id 1. Context has methodinit
to init from a start labelFeatures
RESPONSE
can now be a string. It will be converted toMessage(text=)
automaticallyMessage
)Pipeline
can now be accessed viaContext.pipeline
NodeLabel
class to replace tuple node labelsScript.get_inherited_node
to get a node that inherits global and local properties.ctx.current_node
is obtained via this methodcheck_happy_path
to response_comparator, removed default comparators, removed context from signature; messages inhappy_path
can now be any ofMessage
,dict
,str
;printout_enable
flag renamed toprintout
and madeFalse
by default.ModifyResponse
base processing class which allows modifying current node response.Fixes
slot_name="0"
)Documentation
responses.1_basics
tutorialDevel
log_event_catcher
fixture to help test captured logsTYPE_CHECKING
exclude from coverage; now only certain exception raises are excluded from coveragerun_interactive_mode
. Just usepipeline.run()
.InitTypes
for various BaseModels to indicate types that can be validated into that modelActor
now doesn't have any parametersnormalization
utils replaced with pydantic validatorsScript
can now be validated from a script dict (without thescript
field)Context.cast
. Usemodel_validate
andmodel_validate_json
instead.Checklist
To Consider
.ignore
files, scripts (such aslint
), distribution manifest (if files are added/deleted)