Skip to content

Frontend agent

ALL_TOOLS = list(ToolNames) module-attribute

logger = logging.getLogger(__name__) module-attribute

AgentBeingModifiedState

Bases: BeingModifiedStateBase, MyState

conf_id = rx.field(None) class-attribute instance-attribute

modifiable_values = AgentModifiableValues() class-attribute instance-attribute

options_selector class-attribute

sub_assistant_selector class-attribute

tool_selector class-attribute

create(options_options_loader) classmethod

on_load() async

options_selected_handler() async

set_agent_type(value)

sub_assistant_selected_handler(items)

tool_selected_handler(items)

update(update) async

Update the state based on Update events.

AgentModifiableValues

Bases: ModifiableValuesBase

agent_type = 'basic' class-attribute instance-attribute

options_conf_id = RxConfigID(name='Default', type_=ConfigType.GLOBAL) class-attribute instance-attribute

sub_assistants = [] class-attribute instance-attribute

tools = [] class-attribute instance-attribute

SubAssistantSelection

Bases: Base

name instance-attribute

type instance-attribute

make_sub_assistant_selector(sub_assistant_selected_handler)

Make the selector part of the sub assistant selection.

make_tool_selector(tool_selected_handler)

Make the selector part of the tool selection.

render_sub_assistant_selection(selector_component, selector_state)

Render the complete sub assistant selection area (selector and what is selected).

render_tool_selection(tool_selector_component, tool_selector_state)

Render the complete tool selection area (selector and what is selected).

sub_assistant_items_to_selections(items)

Convert the items from frontend selection component back into selections with types.