Tutti Nuovi

user:thomas utente che ha creato il gist

title:mygist titolo del gist

filename:myfile.txt nome di file nel gist

extension:yml estensione del file nel gist

language:go linguaggio del file nel gist

topic:homelab gists with given topic

Entra


Tutti Nuovi Entra

All gists matching topic chat-app

Più recente creazione
Meno recente creazione
Più recente aggiornamento
Meno recente aggiornamento

timmy / Streamlit 聊天應用示範

0 mi piace
0 forks
1 files
Ultima volta attivo 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:
Più nuovi Più vecchi

Creato da Opengist ⋅ Load: 17ms⋅

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