全部 新建

user:thomas 由用户创建的 Gists

title:mygist 包含指定标题的 Gists

filename:myfile.txt 包含指定文件名的 Gists

extension:yml 包含指定扩展名的 Gists

language:go 包含指定编程语言的 Gists

topic:homelab 具有给定主题的 Gists

登录


全部 新建 登录

所有匹配主题的 Gist 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: 32ms⋅

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