Skip to content

Event handling

logger = logging.getLogger(__name__) module-attribute

AgentCustomizerState

Bases: ConfigCustomizerBase, MyState

current_being_modified_state_type = AgentBeingModifiedState class-attribute

delete_config_func = staticmethod(service_interface.delete_agent_config) class-attribute

load_config_func = staticmethod(service_interface.load_agent_config) class-attribute

save_config_func = staticmethod(service_interface.save_agent_config) class-attribute

schema_class = AgentSchema class-attribute

selector class-attribute

AssistantCustomizerState

Bases: ConfigCustomizerBase, MyState

current_being_modified_state_type = AssistantBeingModifiedState class-attribute

delete_config_func = staticmethod(service_interface.delete_assistant_config) class-attribute

load_config_func = staticmethod(service_interface.load_assistant_config) class-attribute

save_config_func = staticmethod(service_interface.save_assistant_config) class-attribute

schema_class = AssistantSchema class-attribute

selector class-attribute

ConfigCustomizerBase

Bases: HasUpdatableVars, MyState

Handler for each config customizer (assistant, agent, options).

Each initializes a subclass of this providing the ClassVars below.

allow_overwrite = rx.field(False) class-attribute instance-attribute

current_being_modified_state_type class-attribute

delete_config_func class-attribute

load_config_func class-attribute

save_config_func class-attribute

save_name instance-attribute

schema_class class-attribute

selector class-attribute

show_overwrite_dialog = False class-attribute instance-attribute

user_or_global = rx.field('User') class-attribute instance-attribute

user_or_global_type property

cancel() async

delete() async

load() async

Load the selected schema as start point for modification.

overwrite() async

register_selector(selector) classmethod

save() async

Save the modified/new assistant schema.

set_save_name(save_name)

set_user_or_global_action(user_or_global) async

Admin only. Set whether the user or global selection is being modified.

update(update) async

Handle updates that can't be handled directly in event handler.

E.g. -- When saving, we don't know if the schema was updated, created, or no change from the outside

CustomizerError

Bases: FrontendError

OptionsCustomizerState

Bases: ConfigCustomizerBase, MyState

current_being_modified_state_type = OptionsBeingModifiedState class-attribute

delete_config_func = staticmethod(service_interface.delete_options_config) class-attribute

load_config_func = staticmethod(service_interface.load_options_config) class-attribute

save_config_func = staticmethod(service_interface.save_options_config) class-attribute

schema_class = OptionsSchema class-attribute

selector class-attribute