module documentation

Picoware Agent - LLM-powered assistant with chat GUI.

Function run Main frame handler, delegates to current state.
Function start Build main menu. Return True on success.
Function stop Tear down widgets and agent, reset state.
Constant STATE_CHAT Undocumented
Constant STATE_MENU Undocumented
Constant STATE_SETTINGS Undocumented
Constant STATE_SETTINGS_MODEL Undocumented
Constant STATE_SETTINGS_PROVIDER Undocumented
Constant STATE_TYPE Undocumented
Function _back_to_settings_menu Clean up the Choice sub-view and return to the settings menu.
Function _chat_layout Return layout metrics derived from screen size and default font.
Function _draw_bubble Draw a rounded-rect bubble clipped to screen bounds.
Function _get_llm_models Return a list of models for the specified LLM provider.
Function _get_llm_providers Return a list of available LLM providers.
Function _open_model_choice Open a Choice sub-view for selecting the LLM model.
Function _open_provider_choice Open a Choice sub-view for selecting the LLM provider.
Function _render_chat Draw conversation as chat bubbles with scroll and prompt bar.
Function _save_settings Persist the current agent settings to storage.
Function _set_settings Load or create the agent settings.
Function _show_thinking Clear screen and display a centred thinking indicator.
Function _start_settings_menu Show the agent settings menu.
Function _wrap_text Wrap text to max_chars per line, preserving words.
Variable _agent Undocumented
Variable _agent_mode Undocumented
Variable _choice Undocumented
Variable _conversation Undocumented
Variable _max_scroll Undocumented
Variable _menu Undocumented
Variable _mode_label Undocumented
Variable _scroll_offset Undocumented
Variable _settings Undocumented
Variable _settings_menu Undocumented
def run(view_manager):

Main frame handler, delegates to current state.

Parameters
view_manager:ViewManagerThe view manager context.
def start(view_manager) -> bool:

Build main menu. Return True on success.

Parameters
view_manager:ViewManagerThe view manager context.
Returns
boolTrue on success.
def stop(view_manager):

Tear down widgets and agent, reset state.

Parameters
view_manager:ViewManagerThe view manager context.
STATE_CHAT =

Undocumented

Value
micropython.const(1)
STATE_MENU =

Undocumented

Value
micropython.const(0)
STATE_SETTINGS =

Undocumented

Value
micropython.const(3)
STATE_SETTINGS_MODEL =

Undocumented

Value
micropython.const(5)
STATE_SETTINGS_PROVIDER =

Undocumented

Value
micropython.const(4)
STATE_TYPE =

Undocumented

Value
micropython.const(2)
def _back_to_settings_menu(view_manager):

Clean up the Choice sub-view and return to the settings menu.

Parameters
view_manager:ViewManagerThe view manager context.
def _chat_layout(view_manager):

Return layout metrics derived from screen size and default font.

Parameters
view_manager:ViewManagerThe view manager context.
Returns
tupleHeader/prompt/chat geometry and font metrics.
@micropython.native
def _draw_bubble(draw, x, y, w, text_lines, font, bg_color, text_color, pad, clip_top=0):

Draw a rounded-rect bubble clipped to screen bounds.

Parameters
draw:DrawThe drawing context.
x:intLeft position of the bubble.
y:intTop position of the bubble.
w:intWidth of the bubble.
text_lines:listLines of text to draw.
font:FontThe font to use.
bg_color:intBubble background color.
text_color:intText color.
pad:intInner padding in pixels.
clip_top:intY position to clip lines above. Defaults to 0.
Returns
intThe next Y position after the bubble.
def _get_llm_models(view_manager, llm_id: int) -> list:

Return a list of models for the specified LLM provider.

Parameters
view_manager:ViewManagerThe view manager context.
llm_id:intThe provider ID.
Returns
listAvailable model names.
def _get_llm_providers() -> list:

Return a list of available LLM providers.

def _open_model_choice(view_manager):

Open a Choice sub-view for selecting the LLM model.

Parameters
view_manager:ViewManagerThe view manager context.
def _open_provider_choice(view_manager):

Open a Choice sub-view for selecting the LLM provider.

Parameters
view_manager:ViewManagerThe view manager context.
@micropython.native
def _render_chat(view_manager):

Draw conversation as chat bubbles with scroll and prompt bar.

Parameters
view_manager:ViewManagerThe view manager context.
def _save_settings(view_manager) -> bool:

Persist the current agent settings to storage.

Parameters
view_manager:ViewManagerThe view manager context.
Returns
boolTrue on success.
def _set_settings(view_manager):

Load or create the agent settings.

Parameters
view_manager:ViewManagerThe view manager context.
def _show_thinking(view_manager):

Clear screen and display a centred thinking indicator.

Parameters
view_manager:ViewManagerThe view manager context.
def _start_settings_menu(view_manager):

Show the agent settings menu.

Parameters
view_manager:ViewManagerThe view manager context.
@micropython.native
def _wrap_text(text: str, max_chars: int):

Wrap text to max_chars per line, preserving words.

Parameters
text:strThe text to wrap.
max_chars:intMaximum characters per line.
Returns
listWrapped lines of text.
_agent =

Undocumented

_agent_mode =

Undocumented

_choice =

Undocumented

_conversation =

Undocumented

_max_scroll: int =

Undocumented

_menu =

Undocumented

_mode_label: str =

Undocumented

_scroll_offset: int =

Undocumented

_settings =

Undocumented

_settings_menu =

Undocumented