Spaces:
Sleeping
Sleeping
Update app.py
Browse files17 unmodified lines181920212223244 unmodified lines29303132333435363738394041424317 unmodified linesgeneration_config=generation_config,)chat_session = model.start_chat(history=[])# 3. Chatbot Yanıt Fonksiyonudef respond(4 unmodified linestemperature,top_p,):chat_session.history = [{"role": "system", "content": system_message}]for user_msg, assistant_msg in history:if user_msg:chat_session.history.append({"role": "user", "content": user_msg})if assistant_msg:chat_session.history.append({"role": "assistant", "content": assistant_msg})chat_session.history.append({"role": "user", "content": message})response = chat_session.send_message(message)return response.text# 4. Gradio Arayüzü17 unmodified lines1819202122232425262728293031324 unmodified lines373839404142434445464748495051525354555657585960616217 unmodified linesgeneration_config=generation_config,)# Sohbet oturumu başlatmachat_session = model.start_chat(history=[{"role": "model","parts": ["Merhaba! Ben sanal diş hekiminiz. Nasıl yardımcı olabilirim? 🦷 😊"]}])# 3. Chatbot Yanıt Fonksiyonudef respond(4 unmodified linestemperature,top_p,):# Sistemin başlangıç mesajını ayarlıyoruzchat_session.history = [{"role": "system","parts": [system_message]}]# Kullanıcı ve asistan mesajlarını ayarlıyoruzfor user_msg, assistant_msg in history:if user_msg:chat_session.history.append({"role": "user", "parts": [user_msg]})if assistant_msg:chat_session.history.append({"role": "assistant", "parts": [assistant_msg]})# Yeni kullanıcının mesajını ekleyip yanıt alıyoruzchat_session.history.append({"role": "user", "parts": [message]})response = chat_session.send_message(message)# Yanıtı döndürmereturn response.text# 4. Gradio Arayüzü
app.py+24-5