deeppavlov / dialog_flow_designer

Dialog Flow Designer is GUI for Dialog Flow Framework, that is a free and open-source software stack for creating chatbots, released under the terms of Apache License 2.0.
Apache License 2.0
3 stars 2 forks source link

Use `ast` to deal with python files when translating to json-importer #41

Open Ramimashkouk opened 2 months ago

Ramimashkouk commented 2 months ago

Use ast for dealing with python files (conditions.py, responses.py, …) when translating to json-importer as suggested here and here.

Ramimashkouk commented 2 months ago

DFF is gonna tranform some objects like labels (forward, to_fallback, …) to classes as shown below. So using ast might be unnecessary.

# DFF
class Repeat(Label):
  priority: Optional[float] = None
  def __call__()...

# dflowd backend
schemas = {
  cls.__name__: cls.model_json_schema() for cls in labels_classes
}