Full Web App Generator¶
- class besser.generators.web_app.web_app_generator.WebAppGenerator(model: DomainModel, gui_model: GUIModel, output_dir: str = None, agent_models=None, agent_configs=None, agent_model=None, agent_config=None, agent_config_yamls=None)[source]¶
Bases:
GeneratorInterfaceWebAppGenerator is responsible for generating a web application structure based on input B-UML and GUI models. It implements the GeneratorInterface and facilitates the creation of a web application.
- Parameters:
model (DomainModel) – The B-UML model representing the application’s domain.
gui_model (GUIModel) – The GUI model instance containing necessary configurations.
output_dir (str, optional) – Directory where generated code will be saved. Defaults to None.
agent_models (list, optional) – List of agent models. Each agent is generated into
agents/<name>/under the output directory.agent_configs (dict, optional) – Mapping of
agent.name-> config dict, passed per agent to the underlyingBAFGenerator.agent_model – Deprecated. Single-agent back-compat shim. Prefer
agent_models.agent_config – Deprecated. Single-agent back-compat shim. Prefer
agent_configs.
- _abc_impl = <_abc._abc_data object>¶
- _generate_agent(env)[source]¶
Generate agent code for every configured agent model.
Each agent is emitted into
agents/<slug>/under the output directory so that multi-agent projects don’t collide.
- _generate_docker_files(env)[source]¶
Generates Docker-related files for deployment.
- Parameters:
env – The Jinja2 environment for template rendering.
- property agent_config¶
returns the config of the first agent, if any.
- Type:
Deprecated
- property agent_model¶
returns the first agent model, if any.
- Type:
Deprecated
- besser.generators.web_app.web_app_generator.agent_slug(name) str[source]¶
Canonical filesystem slug for an agent.
Reused across the web-app generator (
agents/<slug>/directories, docker-compose build contexts) and the GitHub/Render deploy pipeline. Accepts either a string or an object exposing.name.Filesystem paths, container names, and hostnames are conventionally lowercase.
lowercase=Trueis currentlysafe_var_name’s default, but we pass it explicitly here to document the requirement and to keep this slug stable if the default ever changes.
- besser.generators.web_app.web_app_generator.resolve_intent_recognition_technology(agent_config) str[source]¶
Read the intent-recognition technology from flat or structured agent config.
Mirrors
_resolve_intent_recognition_technologyin the GitHub/Render deploy pipeline (github_deploy_api.py) so local Docker builds agree with Render builds on when the classical (PyTorch-based) intent classifier is in play.