File size: 1,604 Bytes
9cf6111
44df078
9cf6111
56c42d2
44df078
 
 
56c42d2
44df078
 
 
 
56c42d2
 
 
44df078
 
 
56c42d2
44df078
56c42d2
 
 
 
 
 
 
 
 
 
 
 
44df078
 
56c42d2
44df078
 
 
 
56c42d2
44df078
 
56c42d2
 
44df078
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
import gradio as gr
import requests

# Prompt dosyasını al
prompt_url = "https://raw.githubusercontent.com/ALPERALL/AlpDroid/refs/heads/main/prompt.txt"
prompt_text = requests.get(prompt_url).text

# Bot cevabı
def alp_droid_bot(user_input, history):
    response = f"{prompt_text}\n\nKullanıcı: {user_input}\nAlpDroid:"
    return response

# Butonla geçiş fonksiyonu (parametre istemiyor artık)
def start_chat():
    return gr.update(visible=False), gr.update(visible=True)

# Arayüz
with gr.Blocks() as interface:
    # Açılış sayfası
    with gr.Group(visible=True) as intro_page:
        gr.Markdown("""
        ## ❗ Kullanım Şartları ve Sorumluluk Reddi

        **AlpDroid**, ALPERALL tarafından geliştirilen deneysel bir yapay zeka karakteridir. Bu bot:

        - Gerçek bir kişi değildir.
        - Verdiği yanıtlar sadece eğlence ve deneysel amaçlıdır.
        - **Hukuki, tıbbi, finansal veya etik sorumluluk kabul etmez.**
        - Kullanıcı, yazılanları kendi sorumluluğunda yorumlar ve uygular.

        Bu botu kullanarak bu şartları **kabul etmiş sayılırsınız.**
        """)
        accept_btn = gr.Button("✅ Kabul Ediyorum ve Devam Et")

    # Sohbet sayfası
    with gr.Group(visible=False) as chat_page:
        gr.ChatInterface(
            fn=alp_droid_bot,
            title="🤖 AlpDroid'e Hoş Geldin",
            description="ALPERALL tarafından geliştirilen yapay zeka karakteri.",
        )

    # Buton tıklanınca geçiş
    accept_btn.click(fn=start_chat, inputs=[], outputs=[intro_page, chat_page])

interface.launch()