desktop_chat_qt

Attributes

APP_TITLE

_CODE_FENCE_GENERIC

_GEOM_LINE

Classes

AgentWorker

ChatWindow

Functions

escape(→ str)

render_msg(→ str)

Message bubbles via a two-cell table for rock-solid alignment in QTextBrowser:

make_acknowledgement(→ str)

extract_geom_command(→ Tuple[str, str | None])

Find command-like content in assistant text; remove from visible message.

strip_terminate_tokens(→ str)

main()

Module Contents

desktop_chat_qt.APP_TITLE = 'GEOM AI Assistant'[source]
desktop_chat_qt.escape(s: str) str[source]
desktop_chat_qt.render_msg(role: str, content: str) str[source]

Message bubbles via a two-cell table for rock-solid alignment in QTextBrowser: - Assistant: LEFT (pale blue) - User: RIGHT (pale blue)

desktop_chat_qt.make_acknowledgement(user_text: str) str[source]
desktop_chat_qt._CODE_FENCE_GENERIC[source]
desktop_chat_qt._GEOM_LINE[source]
desktop_chat_qt.extract_geom_command(text: str) Tuple[str, str | None][source]

Find command-like content in assistant text; remove from visible message. Priority:

  1. First fenced code block

  2. First ‘geom …’ line (optional leading $)

Returns (cleaned_text, command_or_None).

desktop_chat_qt.strip_terminate_tokens(text: str) str[source]
class desktop_chat_qt.AgentWorker(assistant, messages: List[Dict], parent=None)[source]

Bases: PySide6.QtCore.QThread

finished_with_reply[source]
assistant[source]
messages[source]
run()[source]
class desktop_chat_qt.ChatWindow[source]

Bases: PySide6.QtWidgets.QMainWindow

assistant[source]
messages: List[Dict[str, str]] = [][source]
system_prompt = 'You are a helpful assistant for GEOM. Propose safe shell commands only when appropriate; when...[source]
logo_label[source]
title_label[source]
type_label[source]
_samples = ['"Create a gold nanorod"', '"I want a graphene disk of 3 nm radius"', '"Create a dimer of...[source]
_sample_index = 0[source]
_type_pos = 0[source]
_type_timer[source]
_typewriter_running = True[source]
chat_frame[source]
chat_view[source]
input_frame[source]
input_box[source]
send_btn[source]
_last_user_text = ''[source]
_toggle_counter = 0[source]
_toggles: Dict[str, Dict[str, str]][source]
_set_logo_pixmap(label: PySide6.QtWidgets.QLabel, path: str, target_height_css: int = 56)[source]
_typewriter_tick()[source]
_advance_sample()[source]
on_anchor_clicked(url: PySide6.QtCore.QUrl)[source]
eventFilter(obj, event)[source]
append_chat(message: Dict[str, str])[source]
send_message()[source]
on_agent_reply(reply_message: Dict[str, str])[source]
desktop_chat_qt.main()[source]