feat: Update and submit user value

オープン
#32 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
42/100
issue の種類
機能追加
明瞭さ
おおむね明確
活発さ
停滞
技術スタック
python
領域
frontend

調査の方向性

chat.chat_async("NEW_MSG") のパスと、chat_ui.update_user_input および textarea#chat_user_input 周辺の Shiny UI 統合から始めます。現在の回避策と期待される動作を比較し、プログラムによって設定されたユーザー値が UI を更新し、インタラクティブに送信された場合と同じようにストリーミング応答を表示することを確認します。

索引モデルが issue の本文から書いたものです。

説明

While this feature is directly related towards shiny.ui.Chat, I'm posting the issue here as it is targeted towards chatlas.

Goal: Set and submit user value and display streaming result as if the user had done it.

Using await chat.chat_async("NEW_MSG") does not update the Shiny UI, but it'd be really cool if it did.

Current work around:

@reactive.effect
@reactive.event(trigger)
async def _():
    chat_ui.update_user_input(value="who is the tallest skywalker")

    add_chat_entry = ui.HTML("""
    <script>
        setTimeout(async () => {
            const enterEvent = new KeyboardEvent('keydown', {
                key: 'Enter',
                code: 'Enter',
                keyCode: 13,
                which: 13,
            });

            // Dispatch the 'Enter' event on the input element
            console.log("Dispatching Enter event");
            document.querySelector("textarea#chat_user_input").dispatchEvent(enterEvent);
        }, 500);
    </script>
            """)
    ui.insert_ui(add_chat_entry, "body")
主要言語
Python
スター
179
フォーク
32
平均マージ
1日 3時間
マージ済み PR(30日)
10

環境構築

このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

posit-dev/chatlas のほかの issue

posit-dev/chatlas の issue をすべて見る

似ている issue

Python の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。