holoviz / panel

Panel: The powerful data exploration & web app framework for Python
https://panel.holoviz.org
BSD 3-Clause "New" or "Revised" License
4.78k stars 519 forks source link

Chat Docs issues #5622

Closed MarcSkovMadsen closed 9 months ago

MarcSkovMadsen commented 1 year ago

As the new chat interface is in the dev docs I will start reviewing and add issues here

Dev Docs: https://holoviz-dev.github.io/panel/reference/index.html#widgets

Issues

ChatMessage

ChatFeed

ChatInterface

PanelCallbackHandler

ChatBox

Streamlit migration guide

Card issue in index file

https://holoviz-dev.github.io/panel/how_to/streamlit_migration/index.html

image

Images missing from component gallery

panel-docs

Cannot run dev examples in Pyodide

The problem is that the bokeh js cannot be found. I.e. we cannot test if dev docs works and makes sense.

image

Design Specification image not found

https://holoviz-dev.github.io/panel/reference/widgets/ChatEntry.html

image

Beat boxing cannot play

image

On my mobile it says "fejl" which is danish for "error"

image

Feed without entries is totally flat

This might confuse users

https://holoviz-dev.github.io/panel/reference/widgets/ChatFeed.html#id2

image

Await outside function

image

show_button_name not working

I would expect the buttons to have icons but no text.

image

Images not showing

image

Component Gallery now has many categories without clear ordering.

image

Verbose mentioned but not set

In the ChatFeed Reference notebook

image

hoxbro commented 1 year ago

Do you have the images you want for the gallery?

The second problem is related to the latest Bokeh release, which is unavailable on all channels. My feeling is this will fix itself given time.

MarcSkovMadsen commented 1 year ago

For the second problem I think the cause is that custom wheels are not published for alpha, beta and release candidates via the pipeline.

image

philippjfr commented 1 year ago

They are published but we only publish the latest bokeh version (i.e. 3.3.0 now). Seems like the website was still built with bokeh 3.2.2 for some reason.

MarcSkovMadsen commented 1 year ago

LAST UPDATE: 2023-10-19 14:56

You can for example use these pictures @philippjfr

chat_message

chat_feed

chat_interface

You can finetune via the below

import time

import panel as pn
import pytest
from panel.chat import ChatFeed, ChatInterface, ChatMessage

VIEWPORT = {"width": 500, "height": 500}
PORT = 5007
URL = f"http://localhost:{PORT}"

def run(page, component, zoom):
    server = pn.serve(component, port=PORT, threaded=True, show=False)
    time.sleep(0.2)
    page.goto(URL)
    page.locator("body").evaluate(f"(sel)=>{{sel.style.zoom = {zoom}}}")
    time.sleep(4)
    server.stop()

@pytest.mark.browser_context_args(
    viewport=VIEWPORT
)
def test_chat_message(page):
    component = pn.Column(
        ChatMessage("How may I help?", user="Assistant"),
    )
    run(page, component, 1.25)

@pytest.mark.browser_context_args(
    viewport=VIEWPORT
)
def test_chat_feed(page):
    component = ChatFeed()
    component.send("How may I help?", user="Assistant")
    component.send("You can answer my questions.", user="User")
    run(page, component, 1.25)

@pytest.mark.browser_context_args(
    viewport=VIEWPORT
)
def test_chat_interface(page):
    component = pn.Column(ChatInterface(margin=0), margin=10)
    component[0].send("How may I help?", user="Assistant")
    component[0].send("You can answer my questions.", user="User")
    run(page, component, 1.25)
pytest script.py --headed --screenshot on
ahuang11 commented 1 year ago

This fixes show_button_name https://github.com/holoviz/panel/pull/5652

This fixes await outside notebook https://github.com/holoviz/panel/pull/5653

Adds mention of panel-chat-examples https://github.com/holoviz/panel/pull/5654

MarcSkovMadsen commented 1 year ago

Cannot import name document from js

Seem the ChatMessage docs can now run in pyodide. But then a new issue appears.

image

reference ... isn't known

I also see some errors in the console when runnning ChatMessage reference notebook in pyodide

image

MarcSkovMadsen commented 1 year ago

ChatInterface Perspective examples not working

When I try the upload on the dev site using pyodide it does not work. I don't see anything displayed. And don't see the cause in the browser console either.

image

MarcSkovMadsen commented 1 year ago

The TextInput does not stretch when show_button_name=False

image

UPDATE: THE CAUSE IS THE width=400.

ahuang11 commented 9 months ago

I think this can be closed? If not please open new issues with remaining issues.