全部 新建

user:thomas 由使用者建立的 Gists

title:mygist Gists 的標題

filename:myfile.txt Gists 的檔案名稱

extension:yml Gists 的副檔名

language:go Gists 的程式語言

topic:homelab gists with given topic

登錄


全部 新建 登錄

All gists matching topic chat-app

倒序排序 創建
順序排序 創建
倒序排序 更新
順序排序 更新

timmy / Streamlit 聊天應用示範

0 喜歡
0 分支
1 檔案
最後活躍 10 months ago
此範例展示如何使用 Streamlit 建立簡單的聊天應用,模擬 AI 助手回應使用者輸入。利用 st.chat_message 來顯示對話歷史,並透過 st.chat_input 來獲取使用者輸入,使應用具備互動性,適合用於 AI 對話介面開發。
chat-app interactive-gui llm python streamlit ui-design
1 import streamlit as st
2 import random
3 import time
4
5 st.write("Streamlit loves LLMs! 🤖 [Build your own chat app](https://docs.streamlit.io/develop/tutorials/llms/build-conversational-apps) in minutes, then make it powerful by adding images, dataframes, or even input widgets to the chat.")
6
7 st.caption("Note that this demo app isn't actually connected to any LLMs. Those are expensive ;)")
8
9 # Initialize chat history
10 if "messages" not in st.session_state:
上一頁 下一頁

由 Opengist 提供支持 ⋅ Load: 22ms⋅

繁體中文
Čeština Deutsch English Español Français Magyar Italiano 日本語 Polski Português Русский Türkçe Українська 中文 繁體中文