# A chat app interface


<!-- WARNING: THIS FILE WAS AUTOGENERATED! DO NOT EDIT! -->

## App State and DB

------------------------------------------------------------------------

<a href="https://github.com/northarray/chat/blob/main/chat/chat.py#L39"
target="_blank" style="float:right; font-size:smaller">source</a>

### Dialog

``` python

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

```

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

------------------------------------------------------------------------

<a href="https://github.com/northarray/chat/blob/main/chat/chat.py#L47"
target="_blank" style="float:right; font-size:smaller">source</a>

### AppState

``` python

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

```

## Chat with llm

------------------------------------------------------------------------

<a href="https://github.com/northarray/chat/blob/main/chat/chat.py#L82"
target="_blank" style="float:right; font-size:smaller">source</a>

### bubble

``` python

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

```

*Call self as a function.*

``` python
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

"""
```

``` python
#bubble(content, MsgType.note)
```

``` python
#bubble("Can you help?")
```

------------------------------------------------------------------------

<a href="https://github.com/northarray/chat/blob/main/chat/chat.py#L91"
target="_blank" style="float:right; font-size:smaller">source</a>

### mk_prompt

``` python

def mk_prompt(
    msg, h
):

```

*Call self as a function.*

``` python
mk_prompt("Hello", ["Old message"])
```

    'Past messages: ["Old message"]\n\nCurrent question: Hello'

------------------------------------------------------------------------

<a href="https://github.com/northarray/chat/blob/main/chat/chat.py#L100"
target="_blank" style="float:right; font-size:smaller">source</a>

### setmodel

``` python

def setmodel(
    name:str
):

```

*Call self as a function.*

------------------------------------------------------------------------

<a href="https://github.com/northarray/chat/blob/main/chat/chat.py#L105"
target="_blank" style="float:right; font-size:smaller">source</a>

### modeldropdown

``` python

def modeldropdown(
    
):

```

*Call self as a function.*

------------------------------------------------------------------------

<a href="https://github.com/northarray/chat/blob/main/chat/chat.py#L114"
target="_blank" style="float:right; font-size:smaller">source</a>

### llm_rsp

``` python

def llm_rsp(
    msg
):

```

*Call self as a function.*

------------------------------------------------------------------------

<a href="https://github.com/northarray/chat/blob/main/chat/chat.py#L148"
target="_blank" style="float:right; font-size:smaller">source</a>

### ask_llm

``` python

def ask_llm(
    msg:str
):

```

*Call self as a function.*

------------------------------------------------------------------------

<a href="https://github.com/northarray/chat/blob/main/chat/chat.py#L158"
target="_blank" style="float:right; font-size:smaller">source</a>

### send

``` python

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

```

*Call self as a function.*

------------------------------------------------------------------------

<a href="https://github.com/northarray/chat/blob/main/chat/chat.py#L166"
target="_blank" style="float:right; font-size:smaller">source</a>

### update_h

``` python

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

```

*Call self as a function.*

------------------------------------------------------------------------

<a href="https://github.com/northarray/chat/blob/main/chat/chat.py#L172"
target="_blank" style="float:right; font-size:smaller">source</a>

### load_dialog

``` python

def load_dialog(
    dlgid:int
):

```

*Call self as a function.*

------------------------------------------------------------------------

<a href="https://github.com/northarray/chat/blob/main/chat/chat.py#L179"
target="_blank" style="float:right; font-size:smaller">source</a>

### dlgdropdown

``` python

def dlgdropdown(
    
):

```

*Call self as a function.*

------------------------------------------------------------------------

<a href="https://github.com/northarray/chat/blob/main/chat/chat.py#L191"
target="_blank" style="float:right; font-size:smaller">source</a>

### chatpg

``` python

def chatpg(
    
):

```

*Call self as a function.*
