2 845
اللي بيكون انا فين او قاعد بعمل ايه 🥱
حابب اقول لك ان انا بجهز لكم ملفات بوتات لكل حاجه ❤️🔥 انا جهزتها خلاص اشوف تفاعل انزلها ❤️
03 11月 2024, 14:02
08 4月 2025, ~11:58
بوت تحويل نص الى صوت Text to voice converter bot لغة البرمجية python Python programming language مكاتب Offices ❇️ gtts ❇️ telebotBY: minato
import requests
import re
import json
X = '\033[1;33m' #اصفر
F = '\033[2;32m' #اخضر
Z = '\033[1;31m' #احمر
print(Z + 'Start speeking with Chat Gpt 4 mini')
history =[]
while True:
user_input = input(X + '--> ')
if len(history)<1:
pass
elif len(history) >=2:
user_input = f'''Here’s the translation:
"Based on the history that occurred between you and me: {history}
Please answer or execute the following question: {user_input}"
only answer or execute dont explain what i say only answer or execute pleas
'''
cookies = {
'dcm': '3',
}
headers = {
'authority': 'duckduckgo.com',
'accept': 'text/event-stream',
'accept-language': 'en-US,en;q=0.9,ar;q=0.8',
'content-type': 'application/json',
'origin': 'https://duckduckgo.com',
'referer': 'https://duckduckgo.com/',
'sec-ch-ua': '"Not-A.Brand";v="99", "Chromium";v="124"',
'sec-ch-ua-mobile': '?1',
'sec-ch-ua-platform': '"Android"',
'sec-fetch-dest': 'empty',
'sec-fetch-mode': 'cors',
'sec-fetch-site': 'same-origin',
'user-agent': 'Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/124.0.0.0 Mobile Safari/537.36',
'x-vqd-4': '4-331508058073501916695245038695504576375',
}
json_data = {
'model': 'gpt-4o-mini',
'messages': [
{
'role': 'user',
'content': user_input,
},
],
}
response = requests.post('https://duckduckgo.com/duckchat/v1/chat', cookies=cookies, headers=headers, json=json_data)
data = response.content.decode('utf-8')
matches = re.findall(r'{"message":"(.*?)"', data)
result = ''.join(matches)
cont_his = f'''you:{result}'''
user_his = f'''me:{user_input}'''
history.append(user_his)
history.append(cont_his)
msg = result.replace('\\n', '\n')
print(F + msg)
سورس شات جيبيتي 4mini-io فيه ربط بين الافكار ، اعتقد محدش سواها نفس طريقتي .
By: @devSKO
我们使用 cookie 来改善您的浏览体验。
点击“全部接受”,即表示您同意Cookie 使用政策。