[assets] update readme (#8529)

This commit is contained in:
Yaowei Zheng
2025-07-02 17:42:27 +08:00
committed by GitHub
parent bede213da7
commit 906b31fd47
7 changed files with 40 additions and 27 deletions

View File

@@ -12,6 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import inspect
import json
from typing import TYPE_CHECKING
@@ -50,7 +51,14 @@ def create_chat_box(
) -> tuple["Component", "Component", dict[str, "Component"]]:
lang = engine.manager.get_elem_by_id("top.lang")
with gr.Column(visible=visible) as chat_box:
chatbot = gr.Chatbot(type="messages", show_copy_button=True)
kwargs = {}
if "show_copy_button" in inspect.signature(gr.Chatbot.__init__).parameters:
kwargs["show_copy_button"] = True
if "resizable" in inspect.signature(gr.Chatbot.__init__).parameters:
kwargs["resizable"] = True
chatbot = gr.Chatbot(type="messages", **kwargs)
messages = gr.State([])
with gr.Row():
with gr.Column(scale=4):