A chat app interface

App State and DB


source

Dialog


def Dialog(
    args:VAR_POSITIONAL, kwargs:VAR_KEYWORD
):

Initialize self. See help(type(self)) for accurate signature.


source

AppState


def AppState(
    uid:int=123, h:list=<factory>, dlgid:int=<factory>, dlgname:str=<factory>, model:str='claude-haiku-4-5'
)->None:

Chat with llm


source

bubble


def bubble(
    msg:str, msg_type:MsgType=<MsgType.prompt: 'Prompt'>
):

Call self as a function.

content = """
Here are some _markdown_ elements.

- This is a list item
- This is another list item
- And this is a third list item

**Fenced code blocks work here.**

## A title
Here is some text!
### Another title

"""
#bubble(content, MsgType.note)
#bubble("Can you help?")

source

mk_prompt


def mk_prompt(
    msg, h
):

Call self as a function.

mk_prompt("Hello", ["Old message"])
'Past messages: ["Old message"]\n\nCurrent question: Hello'

source

setmodel


def setmodel(
    name:str
):

Call self as a function.


source

modeldropdown


def modeldropdown(
    
):

Call self as a function.


source

llm_rsp


def llm_rsp(
    msg
):

Call self as a function.


source

ask_llm


def ask_llm(
    msg:str
):

Call self as a function.


source

send


def send(
    msg:str, msg_type:str
):

Call self as a function.


source

update_h


def update_h(
    content:str, author:MsgType
):

Call self as a function.


source

load_dialog


def load_dialog(
    dlgid:int
):

Call self as a function.


source

dlgdropdown


def dlgdropdown(
    
):

Call self as a function.


source

chatpg


def chatpg(
    
):

Call self as a function.