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
"""A chat app interface
App State and DB
Dialog
def Dialog(
args:VAR_POSITIONAL, kwargs:VAR_KEYWORD
):
Initialize self. See help(type(self)) for accurate signature.
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
bubble
def bubble(
msg:str, msg_type:MsgType=<MsgType.prompt: 'Prompt'>
):
Call self as a function.
#bubble(content, MsgType.note)#bubble("Can you help?")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'
setmodel
def setmodel(
name:str
):
Call self as a function.
modeldropdown
def modeldropdown(
):
Call self as a function.
llm_rsp
def llm_rsp(
msg
):
Call self as a function.
ask_llm
def ask_llm(
msg:str
):
Call self as a function.
send
def send(
msg:str, msg_type:str
):
Call self as a function.
update_h
def update_h(
content:str, author:MsgType
):
Call self as a function.
load_dialog
def load_dialog(
dlgid:int
):
Call self as a function.
dlgdropdown
def dlgdropdown(
):
Call self as a function.
chatpg
def chatpg(
):
Call self as a function.