Spaces:
Running
Running
Upload 2 files
Browse files- chatbot_backend.py +425 -0
- streamlit_ui.py +382 -0
chatbot_backend.py
ADDED
@@ -0,0 +1,425 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
"""
|
2 |
+
Chatbot backend işlevselliği.
|
3 |
+
Bu modül, kullanıcı girdisini işleyen ve dinamik promptlar oluşturan ana mantığı içerir.
|
4 |
+
"""
|
5 |
+
|
6 |
+
import os
|
7 |
+
import json
|
8 |
+
import re
|
9 |
+
from typing import Dict, Any, Tuple, List, Optional
|
10 |
+
import openai
|
11 |
+
from google import generativeai as genai
|
12 |
+
import requests
|
13 |
+
from dotenv import load_dotenv
|
14 |
+
|
15 |
+
# Prompt şablonlarını içe aktar
|
16 |
+
from prompt_templates import (
|
17 |
+
PROMPT_CATEGORIES,
|
18 |
+
predict_category,
|
19 |
+
extract_parameters,
|
20 |
+
create_prompt
|
21 |
+
)
|
22 |
+
|
23 |
+
# AI Prompt Generator'ı içe aktar
|
24 |
+
from ai_prompt_generator import AIPromptGenerator
|
25 |
+
|
26 |
+
# .env dosyasını yükle (varsa)
|
27 |
+
load_dotenv()
|
28 |
+
|
29 |
+
class PromptEngineerChatbot:
|
30 |
+
"""
|
31 |
+
Prompt mühendisliği chatbot sınıfı.
|
32 |
+
Bu sınıf, kullanıcı girdisini işleyerek dinamik promptlar oluşturur.
|
33 |
+
"""
|
34 |
+
|
35 |
+
def __init__(self):
|
36 |
+
"""
|
37 |
+
Chatbot'u başlat ve yapılandır.
|
38 |
+
"""
|
39 |
+
self.conversation_history = []
|
40 |
+
self.current_category = None
|
41 |
+
self.current_params = None
|
42 |
+
self.ai_generator = AIPromptGenerator()
|
43 |
+
|
44 |
+
def process_input(self, user_input: str, use_ai_generation: bool = True, provider: str = "openai", model: Optional[str] = None) -> Tuple[str, str, Dict[str, Any]]:
|
45 |
+
"""
|
46 |
+
Kullanıcı girdisini işler ve dinamik bir prompt oluşturur.
|
47 |
+
|
48 |
+
Args:
|
49 |
+
user_input (str): Kullanıcı girdisi
|
50 |
+
use_ai_generation (bool): AI destekli prompt oluşturmayı kullan
|
51 |
+
provider (str): AI sağlayıcısı ('openai', 'gemini', 'openrouter')
|
52 |
+
model (str, optional): Kullanılacak model
|
53 |
+
|
54 |
+
Returns:
|
55 |
+
Tuple[str, str, Dict[str, Any]]: Oluşturulan prompt, kategori ve parametreler
|
56 |
+
"""
|
57 |
+
# Kullanıcı girdisini kaydet
|
58 |
+
self.conversation_history.append({"role": "user", "content": user_input})
|
59 |
+
|
60 |
+
# Kategori tahmini
|
61 |
+
category = predict_category(user_input)
|
62 |
+
|
63 |
+
# Parametreleri çıkar
|
64 |
+
params = extract_parameters(category, user_input)
|
65 |
+
|
66 |
+
# Mevcut kategori ve parametreleri güncelle
|
67 |
+
self.current_category = category
|
68 |
+
self.current_params = params
|
69 |
+
|
70 |
+
# AI destekli prompt oluşturma kullanılıyorsa
|
71 |
+
if use_ai_generation:
|
72 |
+
# Şablon tabanlı promptu oluştur (referans için)
|
73 |
+
template_prompt = create_prompt(category, params)
|
74 |
+
|
75 |
+
# Kategori bilgisini ve şablon promptu kullanarak daha spesifik bir AI prompt oluştur
|
76 |
+
enhanced_user_input = f"""
|
77 |
+
Kategori: {category}
|
78 |
+
|
79 |
+
Kullanıcı İsteği: {user_input}
|
80 |
+
|
81 |
+
Lütfen bu istek için çok detaylı ve spesifik bir prompt oluştur.
|
82 |
+
Şablon olarak aşağıdaki yapıyı kullanabilirsin, ancak içeriği tamamen kullanıcının isteğine göre özelleştir ve çok daha detaylı hale getir:
|
83 |
+
|
84 |
+
{template_prompt}
|
85 |
+
|
86 |
+
Önemli: Yukarıdaki şablonu olduğu gibi kullanma, sadece yapı referansı olarak kullan.
|
87 |
+
İçeriği tamamen kullanıcının isteğine özel olarak oluştur ve çok daha detaylı, spesifik bilgiler ekle.
|
88 |
+
Örneğin, kullanıcı hava durumu uygulaması istiyorsa, hava durumu API'leri, hava verilerinin görselleştirilmesi,
|
89 |
+
hava tahminleri, konum takibi gibi spesifik detaylar ekle.
|
90 |
+
"""
|
91 |
+
|
92 |
+
# AI destekli prompt oluştur
|
93 |
+
result = self.ai_generator.generate_prompt(enhanced_user_input, provider, model)
|
94 |
+
|
95 |
+
if result["success"]:
|
96 |
+
prompt = result["prompt"]
|
97 |
+
else:
|
98 |
+
# AI prompt oluşturma başarısız olursa şablon promptu kullan
|
99 |
+
prompt = template_prompt
|
100 |
+
else:
|
101 |
+
# Şablon tabanlı prompt oluştur
|
102 |
+
prompt = create_prompt(category, params)
|
103 |
+
|
104 |
+
# Chatbot yanıtını kaydet
|
105 |
+
self.conversation_history.append({"role": "assistant", "content": prompt})
|
106 |
+
|
107 |
+
return prompt, category, params
|
108 |
+
|
109 |
+
def get_conversation_history(self) -> List[Dict[str, str]]:
|
110 |
+
"""
|
111 |
+
Konuşma geçmişini döndürür.
|
112 |
+
|
113 |
+
Returns:
|
114 |
+
List[Dict[str, str]]: Konuşma geçmişi
|
115 |
+
"""
|
116 |
+
return self.conversation_history
|
117 |
+
|
118 |
+
def clear_conversation_history(self) -> None:
|
119 |
+
"""
|
120 |
+
Konuşma geçmişini temizler.
|
121 |
+
"""
|
122 |
+
self.conversation_history = []
|
123 |
+
self.current_category = None
|
124 |
+
self.current_params = None
|
125 |
+
|
126 |
+
|
127 |
+
class AIModelInterface:
|
128 |
+
"""
|
129 |
+
Farklı AI API'leri için arayüz sınıfı.
|
130 |
+
Bu sınıf, OpenAI, Google Gemini ve OpenRouter API'leri ile etkileşim sağlar.
|
131 |
+
"""
|
132 |
+
|
133 |
+
def __init__(self):
|
134 |
+
"""
|
135 |
+
AI model arayüzünü başlat.
|
136 |
+
"""
|
137 |
+
self.api_keys = {
|
138 |
+
"openai": os.getenv("OPENAI_API_KEY", ""),
|
139 |
+
"gemini": os.getenv("GEMINI_API_KEY", ""),
|
140 |
+
"openrouter": os.getenv("OPENROUTER_API_KEY", "")
|
141 |
+
}
|
142 |
+
|
143 |
+
def set_api_key(self, provider: str, api_key: str) -> None:
|
144 |
+
"""
|
145 |
+
Belirli bir sağlayıcı için API anahtarını ayarlar.
|
146 |
+
|
147 |
+
Args:
|
148 |
+
provider (str): API sağlayıcısı ('openai', 'gemini', 'openrouter')
|
149 |
+
api_key (str): API anahtarı
|
150 |
+
"""
|
151 |
+
if provider in self.api_keys:
|
152 |
+
self.api_keys[provider] = api_key
|
153 |
+
|
154 |
+
def get_available_models(self, provider: str) -> List[str]:
|
155 |
+
"""
|
156 |
+
Belirli bir sağlayıcı için kullanılabilir modelleri döndürür.
|
157 |
+
|
158 |
+
Args:
|
159 |
+
provider (str): API sağlayıcısı ('openai', 'gemini', 'openrouter')
|
160 |
+
|
161 |
+
Returns:
|
162 |
+
List[str]: Kullanılabilir modeller listesi
|
163 |
+
"""
|
164 |
+
if provider == "openai":
|
165 |
+
return ["gpt-4o", "gpt-4-turbo", "gpt-4", "gpt-3.5-turbo"]
|
166 |
+
elif provider == "gemini":
|
167 |
+
return ["gemini-1.5-pro", "gemini-1.5-flash", "gemini-1.0-pro"]
|
168 |
+
elif provider == "openrouter":
|
169 |
+
return [
|
170 |
+
"openai/gpt-4o",
|
171 |
+
"openai/gpt-4-turbo",
|
172 |
+
"anthropic/claude-3-opus",
|
173 |
+
"anthropic/claude-3-sonnet",
|
174 |
+
"google/gemini-1.5-pro",
|
175 |
+
"meta-llama/llama-3-70b-instruct"
|
176 |
+
]
|
177 |
+
return []
|
178 |
+
|
179 |
+
def generate_with_openai(self, prompt: str, model: str = "gpt-3.5-turbo", api_key: Optional[str] = None) -> str:
|
180 |
+
"""
|
181 |
+
OpenAI API kullanarak yanıt oluşturur.
|
182 |
+
|
183 |
+
Args:
|
184 |
+
prompt (str): Gönderilecek prompt
|
185 |
+
model (str): Kullanılacak model
|
186 |
+
api_key (str, optional): Doğrudan kullanılacak API anahtarı
|
187 |
+
|
188 |
+
Returns:
|
189 |
+
str: Oluşturulan yanıt
|
190 |
+
"""
|
191 |
+
# Doğrudan API anahtarı verilmişse onu kullan, yoksa saklanan anahtarı kullan
|
192 |
+
current_api_key = api_key if api_key else self.api_keys["openai"]
|
193 |
+
|
194 |
+
if not current_api_key:
|
195 |
+
return "OpenAI API anahtarı ayarlanmamış."
|
196 |
+
|
197 |
+
try:
|
198 |
+
# Geçici olarak API anahtarını ayarla
|
199 |
+
openai.api_key = current_api_key
|
200 |
+
|
201 |
+
response = openai.chat.completions.create(
|
202 |
+
model=model,
|
203 |
+
messages=[{"role": "user", "content": prompt}],
|
204 |
+
temperature=0.7,
|
205 |
+
max_tokens=2000
|
206 |
+
)
|
207 |
+
return response.choices[0].message.content
|
208 |
+
except Exception as e:
|
209 |
+
return f"OpenAI API hatası: {str(e)}"
|
210 |
+
|
211 |
+
def generate_with_gemini(self, prompt: str, model: str = "gemini-1.5-pro", api_key: Optional[str] = None) -> str:
|
212 |
+
"""
|
213 |
+
Google Gemini API kullanarak yanıt oluşturur.
|
214 |
+
|
215 |
+
Args:
|
216 |
+
prompt (str): Gönderilecek prompt
|
217 |
+
model (str): Kullanılacak model
|
218 |
+
api_key (str, optional): Doğrudan kullanılacak API anahtarı
|
219 |
+
|
220 |
+
Returns:
|
221 |
+
str: Oluşturulan yanıt
|
222 |
+
"""
|
223 |
+
# Doğrudan API anahtarı verilmişse onu kullan, yoksa saklanan anahtarı kullan
|
224 |
+
current_api_key = api_key if api_key else self.api_keys["gemini"]
|
225 |
+
|
226 |
+
if not current_api_key:
|
227 |
+
return "Gemini API anahtarı ayarlanmamış."
|
228 |
+
|
229 |
+
try:
|
230 |
+
# Geçici olarak API anahtarını ayarla
|
231 |
+
genai.configure(api_key=current_api_key)
|
232 |
+
|
233 |
+
model_obj = genai.GenerativeModel(model)
|
234 |
+
response = model_obj.generate_content(prompt)
|
235 |
+
return response.text
|
236 |
+
except Exception as e:
|
237 |
+
return f"Gemini API hatası: {str(e)}"
|
238 |
+
|
239 |
+
def generate_with_openrouter(self, prompt: str, model: str = "openai/gpt-4-turbo", api_key: Optional[str] = None) -> str:
|
240 |
+
"""
|
241 |
+
OpenRouter API kullanarak yanıt oluşturur.
|
242 |
+
|
243 |
+
Args:
|
244 |
+
prompt (str): Gönderilecek prompt
|
245 |
+
model (str): Kullanılacak model
|
246 |
+
api_key (str, optional): Doğrudan kullanılacak API anahtarı
|
247 |
+
|
248 |
+
Returns:
|
249 |
+
str: Oluşturulan yanıt
|
250 |
+
"""
|
251 |
+
# Doğrudan API anahtarı verilmişse onu kullan, yoksa saklanan anahtarı kullan
|
252 |
+
current_api_key = api_key if api_key else self.api_keys["openrouter"]
|
253 |
+
|
254 |
+
if not current_api_key:
|
255 |
+
return "OpenRouter API anahtarı ayarlanmamış."
|
256 |
+
|
257 |
+
try:
|
258 |
+
headers = {
|
259 |
+
"Content-Type": "application/json",
|
260 |
+
"Authorization": f"Bearer {current_api_key}"
|
261 |
+
}
|
262 |
+
|
263 |
+
data = {
|
264 |
+
"model": model,
|
265 |
+
"messages": [{"role": "user", "content": prompt}],
|
266 |
+
"temperature": 0.7,
|
267 |
+
"max_tokens": 2000
|
268 |
+
}
|
269 |
+
|
270 |
+
response = requests.post(
|
271 |
+
"https://openrouter.ai/api/v1/chat/completions",
|
272 |
+
headers=headers,
|
273 |
+
json=data
|
274 |
+
)
|
275 |
+
|
276 |
+
if response.status_code == 200:
|
277 |
+
return response.json()["choices"][0]["message"]["content"]
|
278 |
+
else:
|
279 |
+
return f"OpenRouter API hatası: {response.status_code} - {response.text}"
|
280 |
+
except Exception as e:
|
281 |
+
return f"OpenRouter API hatası: {str(e)}"
|
282 |
+
|
283 |
+
def generate_code_templates(self, response: str) -> Dict[str, Any]:
|
284 |
+
"""
|
285 |
+
AI yanıtından kod şablonları, dizin yapısı ve uygulama adımlarını çıkarır.
|
286 |
+
|
287 |
+
Args:
|
288 |
+
response (str): AI yanıtı
|
289 |
+
|
290 |
+
Returns:
|
291 |
+
Dict[str, Any]: Kod şablonları, dizin yapısı ve uygulama adımları
|
292 |
+
"""
|
293 |
+
result = {
|
294 |
+
"directory_structure": [],
|
295 |
+
"code_templates": [],
|
296 |
+
"implementation_steps": []
|
297 |
+
}
|
298 |
+
|
299 |
+
# Dizin yapısını çıkar
|
300 |
+
dir_structure_pattern = r"```(?:bash|shell|plaintext)?\s*((?:├──|└──|│\s+|(?:\w+/)+\w+|\w+\.\w+|[\w\-\.\/]+\s*)+)\s*```"
|
301 |
+
dir_matches = re.findall(dir_structure_pattern, response, re.DOTALL)
|
302 |
+
|
303 |
+
if dir_matches:
|
304 |
+
for match in dir_matches:
|
305 |
+
if any(x in match for x in ['├──', '└──', '│', '/']):
|
306 |
+
result["directory_structure"].append(match.strip())
|
307 |
+
|
308 |
+
# Kod şablonlarını çıkar
|
309 |
+
code_pattern = r"```(\w+)?\s*([\s\S]*?)```"
|
310 |
+
code_matches = re.findall(code_pattern, response, re.DOTALL)
|
311 |
+
|
312 |
+
for lang, code in code_matches:
|
313 |
+
if lang and lang.lower() not in ['bash', 'shell', 'plaintext', '']:
|
314 |
+
result["code_templates"].append({
|
315 |
+
"language": lang.strip() if lang else "unknown",
|
316 |
+
"code": code.strip()
|
317 |
+
})
|
318 |
+
|
319 |
+
# Uygulama adımlarını çıkar
|
320 |
+
steps_pattern = r"(?:##|###)\s*(?:Adım|Step|İmplementasyon|Uygulama).*?(?=(?:##|###)|$)"
|
321 |
+
steps_matches = re.findall(steps_pattern, response, re.DOTALL | re.IGNORECASE)
|
322 |
+
|
323 |
+
if steps_matches:
|
324 |
+
result["implementation_steps"] = [step.strip() for step in steps_matches]
|
325 |
+
else:
|
326 |
+
# Numaralı adımları ara
|
327 |
+
numbered_steps = re.findall(r"\d+\.\s+[^\n]+(?:\n(?!\d+\.).*?)*", response, re.DOTALL)
|
328 |
+
if numbered_steps:
|
329 |
+
result["implementation_steps"] = [step.strip() for step in numbered_steps]
|
330 |
+
|
331 |
+
return result
|
332 |
+
|
333 |
+
def generate_response_with_code_templates(self, provider: str, prompt: str, model: Optional[str] = None, api_key: Optional[str] = None) -> Dict[str, Any]:
|
334 |
+
"""
|
335 |
+
Belirli bir sağlayıcı ve model kullanarak yanıt ve kod şablonları oluşturur.
|
336 |
+
|
337 |
+
Args:
|
338 |
+
provider (str): API sağlayıcısı ('openai', 'gemini', 'openrouter')
|
339 |
+
prompt (str): Gönderilecek prompt
|
340 |
+
model (str, optional): Kullanılacak model
|
341 |
+
api_key (str, optional): Doğrudan kullanılacak API anahtarı
|
342 |
+
|
343 |
+
Returns:
|
344 |
+
Dict[str, Any]: Yanıt ve kod şablonları
|
345 |
+
"""
|
346 |
+
# Promptu geliştir - kod şablonları, dizin yapısı ve uygulama adımları isteyelim
|
347 |
+
enhanced_prompt = f"""
|
348 |
+
{prompt}
|
349 |
+
|
350 |
+
Lütfen yanıtında aşağıdakileri mutlaka içer:
|
351 |
+
|
352 |
+
1. Detaylı bir dizin yapısı (klasör ve dosya hiyerarşisi)
|
353 |
+
2. Önemli dosyaların kod şablonları (HTML, CSS, JavaScript, Python vb.)
|
354 |
+
3. Adım adım uygulama talimatları
|
355 |
+
|
356 |
+
Dizin yapısını ```bash veya ```plaintext içinde göster.
|
357 |
+
Kod şablonlarını ```html, ```css, ```javascript, ```python gibi uygun dil belirteçleriyle göster.
|
358 |
+
Uygulama adımlarını numaralandırılmış liste olarak veya ## Adım başlıkları altında göster.
|
359 |
+
"""
|
360 |
+
|
361 |
+
# Yanıt oluştur
|
362 |
+
response = self.generate_response(provider, enhanced_prompt, model, api_key)
|
363 |
+
|
364 |
+
# Yanıttan kod şablonlarını çıkar
|
365 |
+
templates = self.generate_code_templates(response)
|
366 |
+
|
367 |
+
return {
|
368 |
+
"response": response,
|
369 |
+
"templates": templates
|
370 |
+
}
|
371 |
+
|
372 |
+
def generate_response(self, provider: str, prompt: str, model: Optional[str] = None, api_key: Optional[str] = None) -> str:
|
373 |
+
"""
|
374 |
+
Belirli bir sağlayıcı ve model kullanarak yanıt oluşturur.
|
375 |
+
|
376 |
+
Args:
|
377 |
+
provider (str): API sağlayıcısı ('openai', 'gemini', 'openrouter')
|
378 |
+
prompt (str): Gönderilecek prompt
|
379 |
+
model (str, optional): Kullanılacak model
|
380 |
+
api_key (str, optional): Doğrudan kullanılacak API anahtarı
|
381 |
+
|
382 |
+
Returns:
|
383 |
+
str: Oluşturulan yanıt
|
384 |
+
"""
|
385 |
+
if provider == "openai":
|
386 |
+
if model is None:
|
387 |
+
model = "gpt-3.5-turbo"
|
388 |
+
return self.generate_with_openai(prompt, model, api_key)
|
389 |
+
elif provider == "gemini":
|
390 |
+
if model is None:
|
391 |
+
model = "gemini-1.5-pro"
|
392 |
+
return self.generate_with_gemini(prompt, model, api_key)
|
393 |
+
elif provider == "openrouter":
|
394 |
+
if model is None:
|
395 |
+
model = "openai/gpt-4-turbo"
|
396 |
+
return self.generate_with_openrouter(prompt, model, api_key)
|
397 |
+
else:
|
398 |
+
return "Geçersiz sağlayıcı. Lütfen 'openai', 'gemini' veya 'openrouter' seçin."
|
399 |
+
|
400 |
+
|
401 |
+
# Chatbot ve AI model arayüzü örneklerini oluştur
|
402 |
+
chatbot = PromptEngineerChatbot()
|
403 |
+
ai_interface = AIModelInterface()
|
404 |
+
|
405 |
+
# Test fonksiyonu
|
406 |
+
def test_chatbot():
|
407 |
+
"""
|
408 |
+
Chatbot'u test eder.
|
409 |
+
"""
|
410 |
+
test_input = "Bir e-ticaret web sitesi yapmak istiyorum. Ürünleri listeleyebilmeli, sepete ekleyebilmeli ve ödeme alabilmeliyim."
|
411 |
+
prompt, category, params = chatbot.process_input(test_input, use_ai_generation=True)
|
412 |
+
|
413 |
+
print(f"Kategori: {category}")
|
414 |
+
print(f"Parametreler: {json.dumps(params, indent=2, ensure_ascii=False)}")
|
415 |
+
print("\nOluşturulan Prompt:")
|
416 |
+
print(prompt)
|
417 |
+
|
418 |
+
# API yanıtı test (API anahtarı varsa)
|
419 |
+
if ai_interface.api_keys["openai"]:
|
420 |
+
print("\nOpenAI Yanıtı:")
|
421 |
+
response = ai_interface.generate_response("openai", prompt)
|
422 |
+
print(response)
|
423 |
+
|
424 |
+
if __name__ == "__main__":
|
425 |
+
test_chatbot()
|
streamlit_ui.py
ADDED
@@ -0,0 +1,382 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
"""
|
2 |
+
Streamlit UI için modül.
|
3 |
+
Bu modül, Streamlit kullanarak web arayüzünü oluşturur.
|
4 |
+
"""
|
5 |
+
|
6 |
+
import streamlit as st
|
7 |
+
import os
|
8 |
+
from typing import Dict, Any, Optional
|
9 |
+
|
10 |
+
# Kendi modüllerimizi içe aktar
|
11 |
+
from prompt_templates import PROMPT_CATEGORIES
|
12 |
+
from chatbot_backend import chatbot, ai_interface
|
13 |
+
from api_integrations import (
|
14 |
+
api_manager,
|
15 |
+
openai_handler,
|
16 |
+
gemini_handler,
|
17 |
+
openrouter_handler
|
18 |
+
)
|
19 |
+
|
20 |
+
def main():
|
21 |
+
"""
|
22 |
+
Ana Streamlit uygulaması.
|
23 |
+
"""
|
24 |
+
# Sayfa yapılandırması
|
25 |
+
st.set_page_config(
|
26 |
+
page_title="AI MEVZULARI - Prompt Mühendisi (Eray Coşkun Tarafından Aboneleri için geliştirilmiştir)",
|
27 |
+
page_icon="🤖",
|
28 |
+
layout="wide",
|
29 |
+
initial_sidebar_state="expanded"
|
30 |
+
)
|
31 |
+
|
32 |
+
# Session state başlatma
|
33 |
+
if "api_keys" not in st.session_state:
|
34 |
+
st.session_state.api_keys = {
|
35 |
+
"openai": os.getenv("OPENAI_API_KEY", ""),
|
36 |
+
"gemini": os.getenv("GEMINI_API_KEY", ""),
|
37 |
+
"openrouter": os.getenv("OPENROUTER_API_KEY", "")
|
38 |
+
}
|
39 |
+
|
40 |
+
# Başlık ve açıklama
|
41 |
+
st.title("AI MEVZULARI - Prompt Mühendisi (Eray Coşkun Tarafından Aboneleri için geliştirilmiştir)")
|
42 |
+
st.markdown("Bu uygulama, AI modellerine verilecek detaylı promptlar oluşturmanıza yardımcı olur.")
|
43 |
+
|
44 |
+
# Sidebar - API anahtarları
|
45 |
+
with st.sidebar:
|
46 |
+
st.header("API Anahtarları")
|
47 |
+
|
48 |
+
st.info("API anahtarlarınızı girin. Bu anahtarlar oturum süresince saklanır ve sayfayı yenilediğinizde silinir.")
|
49 |
+
|
50 |
+
# OpenAI API anahtarı
|
51 |
+
openai_api_key = st.text_input(
|
52 |
+
"OpenAI API Anahtarı",
|
53 |
+
type="password",
|
54 |
+
value=st.session_state.api_keys.get("openai", "")
|
55 |
+
)
|
56 |
+
|
57 |
+
# Google Gemini API anahtarı
|
58 |
+
gemini_api_key = st.text_input(
|
59 |
+
"Google Gemini API Anahtarı",
|
60 |
+
type="password",
|
61 |
+
value=st.session_state.api_keys.get("gemini", "")
|
62 |
+
)
|
63 |
+
|
64 |
+
# OpenRouter API anahtarı
|
65 |
+
openrouter_api_key = st.text_input(
|
66 |
+
"OpenRouter API Anahtarı",
|
67 |
+
type="password",
|
68 |
+
value=st.session_state.api_keys.get("openrouter", "")
|
69 |
+
)
|
70 |
+
|
71 |
+
# API anahtarlarını kaydet
|
72 |
+
if st.button("API Anahtarlarını Kaydet"):
|
73 |
+
# Session state'e API anahtarlarını kaydet
|
74 |
+
st.session_state.api_keys = {
|
75 |
+
"openai": openai_api_key,
|
76 |
+
"gemini": gemini_api_key,
|
77 |
+
"openrouter": openrouter_api_key
|
78 |
+
}
|
79 |
+
|
80 |
+
# API anahtarlarını ayarla
|
81 |
+
api_manager.set_api_key("openai", openai_api_key)
|
82 |
+
api_manager.set_api_key("gemini", gemini_api_key)
|
83 |
+
api_manager.set_api_key("openrouter", openrouter_api_key)
|
84 |
+
|
85 |
+
# API işleyicilerine de anahtarları ayarla
|
86 |
+
openai_handler.set_api_key(openai_api_key)
|
87 |
+
gemini_handler.set_api_key(gemini_api_key)
|
88 |
+
openrouter_handler.set_api_key(openrouter_api_key)
|
89 |
+
|
90 |
+
# Chatbot'un AI prompt generator'ına da anahtarları ayarla
|
91 |
+
chatbot.ai_generator.set_api_key("openai", openai_api_key)
|
92 |
+
chatbot.ai_generator.set_api_key("gemini", gemini_api_key)
|
93 |
+
chatbot.ai_generator.set_api_key("openrouter", openrouter_api_key)
|
94 |
+
|
95 |
+
st.success("API anahtarları başarıyla kaydedildi!")
|
96 |
+
|
97 |
+
# API anahtarlarının durumunu göster
|
98 |
+
with st.expander("API Anahtarı Durumu", expanded=False):
|
99 |
+
openai_status = "✅ Ayarlandı" if st.session_state.api_keys.get("openai") else "❌ Ayarlanmadı"
|
100 |
+
gemini_status = "✅ Ayarlandı" if st.session_state.api_keys.get("gemini") else "❌ Ayarlanmadı"
|
101 |
+
openrouter_status = "✅ Ayarlandı" if st.session_state.api_keys.get("openrouter") else "❌ Ayarlanmadı"
|
102 |
+
|
103 |
+
st.write(f"OpenAI API: {openai_status}")
|
104 |
+
st.write(f"Gemini API: {gemini_status}")
|
105 |
+
st.write(f"OpenRouter API: {openrouter_status}")
|
106 |
+
|
107 |
+
# AI modeli seçimi
|
108 |
+
st.header("AI Modeli Seçimi")
|
109 |
+
|
110 |
+
# API sağlayıcısı seçimi
|
111 |
+
provider = st.selectbox(
|
112 |
+
"API Sağlayıcısı",
|
113 |
+
["OpenAI", "Google Gemini", "OpenRouter"],
|
114 |
+
index=0
|
115 |
+
)
|
116 |
+
|
117 |
+
# Seçilen sağlayıcıya göre model listesini al
|
118 |
+
provider_key = provider.lower().replace(" ", "_")
|
119 |
+
if provider_key == "google_gemini":
|
120 |
+
provider_key = "gemini"
|
121 |
+
|
122 |
+
# Modelleri al
|
123 |
+
models = []
|
124 |
+
if provider_key == "openai":
|
125 |
+
models = openai_handler.get_available_models()
|
126 |
+
elif provider_key == "gemini":
|
127 |
+
models = gemini_handler.get_available_models()
|
128 |
+
elif provider_key == "openrouter":
|
129 |
+
models = openrouter_handler.get_available_models()
|
130 |
+
|
131 |
+
# Model seçimi
|
132 |
+
selected_model = None
|
133 |
+
if models:
|
134 |
+
selected_model = st.selectbox("Model", models)
|
135 |
+
|
136 |
+
# Ana içerik
|
137 |
+
col1, col2 = st.columns([1, 1])
|
138 |
+
|
139 |
+
with col1:
|
140 |
+
st.header("Prompt Oluştur")
|
141 |
+
|
142 |
+
# Kullanıcı girdisi
|
143 |
+
user_input = st.text_area(
|
144 |
+
"Ne yapmak istediğinizi açıklayın:",
|
145 |
+
height=150,
|
146 |
+
placeholder="Örnek: Bir e-ticaret web sitesi yapmak istiyorum. Ürünleri listeleyebilmeli, sepete ekleyebilmeli ve ödeme alabilmeliyim."
|
147 |
+
)
|
148 |
+
|
149 |
+
# AI destekli prompt oluşturma seçeneği
|
150 |
+
if "use_ai_generation" not in st.session_state:
|
151 |
+
st.session_state.use_ai_generation = True
|
152 |
+
|
153 |
+
use_ai_generation = st.checkbox(
|
154 |
+
"AI destekli prompt oluşturma kullan",
|
155 |
+
value=st.session_state.use_ai_generation,
|
156 |
+
key="use_ai_generation_checkbox"
|
157 |
+
)
|
158 |
+
|
159 |
+
# Checkbox değiştiğinde session state'i güncelle
|
160 |
+
st.session_state.use_ai_generation = use_ai_generation
|
161 |
+
|
162 |
+
# API anahtarı kontrolü ve uyarı
|
163 |
+
selected_provider_key = provider.lower().replace(" ", "_")
|
164 |
+
if selected_provider_key == "google_gemini":
|
165 |
+
selected_provider_key = "gemini"
|
166 |
+
|
167 |
+
if use_ai_generation and not st.session_state.api_keys.get(selected_provider_key):
|
168 |
+
st.warning(f"AI destekli prompt oluşturma için {provider} API anahtarı gereklidir. Lütfen API anahtarınızı girin ve 'API Anahtarlarını Kaydet' butonuna tıklayın.")
|
169 |
+
|
170 |
+
# Prompt oluştur butonu
|
171 |
+
if st.button("Prompt Oluştur"):
|
172 |
+
if user_input:
|
173 |
+
with st.spinner("Prompt oluşturuluyor..."):
|
174 |
+
# Prompt oluştur
|
175 |
+
provider_key = provider.lower().replace(" ", "_")
|
176 |
+
if provider_key == "google_gemini":
|
177 |
+
provider_key = "gemini"
|
178 |
+
|
179 |
+
# API anahtarı kontrolü
|
180 |
+
if use_ai_generation and not st.session_state.api_keys.get(provider_key):
|
181 |
+
st.error(f"AI destekli prompt oluşturma için {provider} API anahtarı gereklidir. Lütfen API anahtarınızı girin ve 'API Anahtarlarını Kaydet' butonuna tıklayın.")
|
182 |
+
else:
|
183 |
+
# Debug bilgisi
|
184 |
+
st.session_state.debug_info = {
|
185 |
+
"use_ai_generation": use_ai_generation,
|
186 |
+
"provider": provider_key,
|
187 |
+
"model": selected_model,
|
188 |
+
"api_key_set": bool(st.session_state.api_keys.get(provider_key))
|
189 |
+
}
|
190 |
+
|
191 |
+
prompt, category, params = chatbot.process_input(
|
192 |
+
user_input,
|
193 |
+
use_ai_generation=use_ai_generation,
|
194 |
+
provider=provider_key,
|
195 |
+
model=selected_model
|
196 |
+
)
|
197 |
+
|
198 |
+
# Sonuçları session state'e kaydet
|
199 |
+
st.session_state.prompt = prompt
|
200 |
+
st.session_state.category = category
|
201 |
+
st.session_state.params = params
|
202 |
+
|
203 |
+
# Sonuçları göster
|
204 |
+
st.success("Prompt başarıyla oluşturuldu!")
|
205 |
+
else:
|
206 |
+
st.error("Lütfen ne yapmak istediğinizi açıklayın.")
|
207 |
+
|
208 |
+
with col2:
|
209 |
+
st.header("Oluşturulan Prompt")
|
210 |
+
|
211 |
+
# Debug bilgisi (geliştirme aşamasında)
|
212 |
+
if "debug_info" in st.session_state:
|
213 |
+
with st.expander("Debug Bilgisi", expanded=False):
|
214 |
+
st.write(st.session_state.debug_info)
|
215 |
+
|
216 |
+
# Oluşturulan promptu göster
|
217 |
+
if "prompt" in st.session_state:
|
218 |
+
st.subheader(f"Kategori: {st.session_state.category}")
|
219 |
+
|
220 |
+
# Parametreleri göster
|
221 |
+
if st.session_state.params:
|
222 |
+
with st.expander("Parametreler", expanded=False):
|
223 |
+
for key, value in st.session_state.params.items():
|
224 |
+
st.write(f"**{key}:** {value}")
|
225 |
+
|
226 |
+
# Promptu göster
|
227 |
+
st.text_area(
|
228 |
+
"Prompt:",
|
229 |
+
value=st.session_state.prompt,
|
230 |
+
height=400,
|
231 |
+
disabled=True
|
232 |
+
)
|
233 |
+
|
234 |
+
# Promptu kopyala butonu
|
235 |
+
if st.button("Promptu Kopyala"):
|
236 |
+
st.code(st.session_state.prompt)
|
237 |
+
st.info("Yukarıdaki kodu seçip kopyalayabilirsiniz.")
|
238 |
+
|
239 |
+
# AI ile Test Et bölümü
|
240 |
+
st.subheader("AI ile Test Et")
|
241 |
+
|
242 |
+
# Test için API sağlayıcısı seçimi
|
243 |
+
test_provider = st.selectbox(
|
244 |
+
"Test için API Sağlayıcısı",
|
245 |
+
["OpenAI", "Google Gemini", "OpenRouter"],
|
246 |
+
index=0,
|
247 |
+
key="test_provider"
|
248 |
+
)
|
249 |
+
|
250 |
+
# Test için model seçimi
|
251 |
+
test_provider_key = test_provider.lower().replace(" ", "_")
|
252 |
+
if test_provider_key == "google_gemini":
|
253 |
+
test_provider_key = "gemini"
|
254 |
+
|
255 |
+
# Test için modelleri al
|
256 |
+
test_models = []
|
257 |
+
if test_provider_key == "openai":
|
258 |
+
test_models = openai_handler.get_available_models()
|
259 |
+
elif test_provider_key == "gemini":
|
260 |
+
test_models = gemini_handler.get_available_models()
|
261 |
+
elif test_provider_key == "openrouter":
|
262 |
+
test_models = openrouter_handler.get_available_models()
|
263 |
+
|
264 |
+
# Test için model seçimi
|
265 |
+
test_selected_model = None
|
266 |
+
if test_models:
|
267 |
+
test_selected_model = st.selectbox("Test için Model", test_models, key="test_model")
|
268 |
+
|
269 |
+
# Test için API anahtarı giriş alanı
|
270 |
+
st.markdown("### Test için API Anahtarı")
|
271 |
+
st.info("Test için API anahtarını doğrudan buraya girebilirsiniz.")
|
272 |
+
|
273 |
+
test_api_key = st.text_input(
|
274 |
+
f"{test_provider} API Anahtarı (Test için)",
|
275 |
+
type="password",
|
276 |
+
key="test_api_key"
|
277 |
+
)
|
278 |
+
|
279 |
+
# Kod şablonları oluşturma seçeneği
|
280 |
+
generate_code_templates = st.checkbox("Kod şablonları ve dizin yapısı oluştur", value=True, key="generate_code_templates")
|
281 |
+
|
282 |
+
# AI ile Test Et butonu
|
283 |
+
if st.button("AI ile Test Et"):
|
284 |
+
if "prompt" in st.session_state:
|
285 |
+
if not test_api_key:
|
286 |
+
st.error(f"Lütfen test için {test_provider} API anahtarını girin.")
|
287 |
+
else:
|
288 |
+
with st.spinner("AI yanıtı alınıyor..."):
|
289 |
+
if generate_code_templates:
|
290 |
+
# Kod şablonları ile yanıt al
|
291 |
+
result = ai_interface.generate_response_with_code_templates(
|
292 |
+
test_provider_key,
|
293 |
+
st.session_state.prompt,
|
294 |
+
test_selected_model,
|
295 |
+
test_api_key
|
296 |
+
)
|
297 |
+
|
298 |
+
# Yanıtı ve şablonları session state'e kaydet
|
299 |
+
st.session_state.ai_response = result["response"]
|
300 |
+
st.session_state.code_templates = result["templates"]
|
301 |
+
else:
|
302 |
+
# Sadece yanıt al
|
303 |
+
response = ai_interface.generate_response(
|
304 |
+
test_provider_key,
|
305 |
+
st.session_state.prompt,
|
306 |
+
test_selected_model,
|
307 |
+
test_api_key
|
308 |
+
)
|
309 |
+
|
310 |
+
# Yanıtı session state'e kaydet
|
311 |
+
st.session_state.ai_response = response
|
312 |
+
if "code_templates" in st.session_state:
|
313 |
+
del st.session_state.code_templates
|
314 |
+
|
315 |
+
# Yanıtı göster
|
316 |
+
st.success("AI yanıtı başarıyla alındı!")
|
317 |
+
else:
|
318 |
+
st.error("Lütfen önce bir prompt oluşturun.")
|
319 |
+
|
320 |
+
# AI yanıtını göster
|
321 |
+
if "ai_response" in st.session_state:
|
322 |
+
st.subheader("AI Yanıtı")
|
323 |
+
st.text_area(
|
324 |
+
"Yanıt:",
|
325 |
+
value=st.session_state.ai_response,
|
326 |
+
height=400,
|
327 |
+
disabled=True
|
328 |
+
)
|
329 |
+
|
330 |
+
# Kod şablonları ve dizin yapısı varsa göster
|
331 |
+
if "code_templates" in st.session_state:
|
332 |
+
templates = st.session_state.code_templates
|
333 |
+
|
334 |
+
# Dizin yapısı
|
335 |
+
if templates["directory_structure"]:
|
336 |
+
with st.expander("📁 Dizin Yapısı", expanded=True):
|
337 |
+
for structure in templates["directory_structure"]:
|
338 |
+
st.code(structure, language="bash")
|
339 |
+
|
340 |
+
# Kod şablonları
|
341 |
+
if templates["code_templates"]:
|
342 |
+
with st.expander("💻 Kod Şablonları", expanded=True):
|
343 |
+
for template in templates["code_templates"]:
|
344 |
+
st.subheader(f"{template['language'].capitalize()} Dosyası")
|
345 |
+
st.code(template["code"], language=template["language"])
|
346 |
+
|
347 |
+
# Uygulama adımları
|
348 |
+
if templates["implementation_steps"]:
|
349 |
+
with st.expander("📝 Uygulama Adımları", expanded=True):
|
350 |
+
for i, step in enumerate(templates["implementation_steps"]):
|
351 |
+
if not step.startswith(f"{i+1}.") and not step.startswith("##"):
|
352 |
+
st.markdown(f"**Adım {i+1}:** {step}")
|
353 |
+
else:
|
354 |
+
st.markdown(step)
|
355 |
+
else:
|
356 |
+
st.info("Henüz bir prompt oluşturulmadı. Sol taraftaki formu doldurup 'Prompt Oluştur' butonuna tıklayın.")
|
357 |
+
|
358 |
+
# Kategori bilgileri
|
359 |
+
st.header("Desteklenen Kategoriler")
|
360 |
+
|
361 |
+
# Kategorileri göster
|
362 |
+
categories_per_row = 3
|
363 |
+
categories = list(PROMPT_CATEGORIES.keys())
|
364 |
+
|
365 |
+
for i in range(0, len(categories), categories_per_row):
|
366 |
+
cols = st.columns(categories_per_row)
|
367 |
+
for j in range(categories_per_row):
|
368 |
+
if i + j < len(categories):
|
369 |
+
with cols[j]:
|
370 |
+
category = categories[i + j]
|
371 |
+
st.subheader(category)
|
372 |
+
if isinstance(PROMPT_CATEGORIES[category], dict) and "description" in PROMPT_CATEGORIES[category]:
|
373 |
+
st.write(PROMPT_CATEGORIES[category]["description"])
|
374 |
+
else:
|
375 |
+
st.write("Bu kategori için açıklama bulunmuyor.")
|
376 |
+
|
377 |
+
# Footer
|
378 |
+
st.markdown("---")
|
379 |
+
st.markdown("© 2025 AI Prompt Generator | Tüm hakları saklıdır.| created by Eray Coşkun")
|
380 |
+
|
381 |
+
if __name__ == "__main__":
|
382 |
+
main()
|