All New

user:thomas gists created by user

title:mygist gists with given title

filename:myfile.txt gists having files with given name

extension:yml gists having files with given extension

language:go gists having files with given language

topic:homelab gists with given topic

Login


All New Login

All gists matching topic chat-app

Recently created
Least recently created
Recently updated
Least recently updated

timmy / Streamlit 聊天應用示範

0 likes
0 forks
1 files
Last active 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:
Newer Older

Powered by Opengist ⋅ Load: 17ms⋅

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