Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
__pycache__
myenv
25 changes: 25 additions & 0 deletions app2.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
from flask import Flask, render_template
from flask_socketio import SocketIO, emit
from character_responce import ai_palm_response

app = Flask(__name__)
app.config['SECRET_KEY'] = 'your_secret_key' # Replace with a secure key
socketio = SocketIO(app)

@app.route('/')
def index():
return render_template('index.html')
ai_palm_response = ai_palm_response.AIResponse("AIzaSyDiqEPDpI47Qd4Je3I3chb5-z2ZQyKu3gk",background="i am dhoni")

@socketio.on('my_event')
def handle_my_event(data):

response = ai_palm_response.generate_res('stay in your character')
speech=data['message']
response = ai_palm_response.generate_res(speech)

message = response
emit('my_response', {'message': message})

if __name__ == '__main__':
socketio.run(app)
4 changes: 4 additions & 0 deletions config.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import os

class config(object):
SECRET_KY = os.environ.get('SECRET_KEY') or "secret_string"
18 changes: 18 additions & 0 deletions f.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
bidict==0.22.1
blinker==1.7.0
certifi==2023.11.17
click==8.1.7
colorama==0.4.6
dnspython==2.4.2
Flask==3.0.0
Flask-SocketIO==5.3.6
h11==0.14.0
httpcore==1.0.2
itsdangerous==2.1.2
Jinja2==3.1.2
MarkupSafe==2.1.3
python-engineio==4.8.1
python-socketio==5.10.0
simple-websocket==1.0.0
Werkzeug==3.0.1
wsproto==1.2.0
115 changes: 115 additions & 0 deletions file.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,115 @@
aiohttp==3.8.6
aiosignal==1.3.1
annotated-types==0.6.0
asttokens==2.4.1
async-timeout==4.0.3
attrs==23.1.0
beautifulsoup4==4.12.2
blinker==1.6.3
cachetools==5.3.1
certifi==2023.7.22
cffi==1.16.0
chardet==3.0.4
charset-normalizer==3.3.0
click==8.1.7
colorama==0.4.6
comtypes==1.2.0
contourpy==1.2.0
cycler==0.12.1
decorator==5.1.1
elevenlabs==0.2.26
executing==2.0.1
filelock==3.12.4
Flask==3.0.0
Flask-WTF==1.2.1
fonttools==4.44.3
frozenlist==1.4.0
fsspec==2023.9.2
generativeai==0.0.1
google==3.0.0
google-ai-generativelanguage==0.3.3
google-api-core==2.12.0
google-auth==2.23.3
google-cloud-speech==2.21.1
google-generativeai==0.2.1
googleapis-common-protos==1.61.0
googletrans==4.0.0rc1
grpcio==1.59.0
grpcio-status==1.59.0
gTTS==2.4.0
h11==0.9.0
h2==3.2.0
hpack==3.0.0
hstspreload==2023.1.1
httpcore==0.9.1
httpx==0.13.3
huggingface-hub==0.18.0
hyperframe==5.2.0
idna==2.10
ipython==8.17.2
itsdangerous==2.1.2
jedi==0.19.1
Jinja2==3.1.2
joblib==1.3.2
kiwisolver==1.4.5
MarkupSafe==2.1.3
matplotlib-inline==0.1.6
mpyg321==2.1.1
multidict==6.0.4
nltk==3.8.1
numpy==1.26.2
openai==0.28.1
outcome==1.3.0
packaging==23.2
pandas==2.1.3
parso==0.8.3
pexpect==4.8.0
Pillow==10.1.0
playsound==1.3.0
prompt-toolkit==3.0.39
proto-plus==1.22.3
protobuf==4.24.4
ptyprocess==0.7.0
pure-eval==0.2.2
pyasn1==0.5.0
pyasn1-modules==0.3.0
PyAudio==0.2.13
pycparser==2.21
pydantic==2.4.2
pydantic_core==2.10.1
pygame==2.5.2
Pygments==2.16.1
pyparsing==3.1.1
pypiwin32==223
PySocks==1.7.1
python-dateutil==2.8.2
python-dotenv==1.0.0
pyttsx3==2.90
pytz==2023.3.post1
pywin32==306
PyYAML==6.0.1
regex==2023.10.3
requests==2.31.0
rfc3986==1.5.0
rsa==4.9
selenium==4.14.0
six==1.16.0
sniffio==1.3.0
sortedcontainers==2.4.0
soupsieve==2.5
SpeechRecognition==3.10.0
stack-data==0.6.3
tqdm==4.66.1
traitlets==5.13.0
trio==0.22.2
trio-websocket==0.11.1
typing_extensions==4.8.0
tzdata==2023.3
urllib3==2.0.6
wcwidth==0.2.9
websockets==12.0
Werkzeug==3.0.1
wikipedia==1.4.0
wsproto==1.2.0
WTForms==3.1.1
yarl==1.9.2
105 changes: 105 additions & 0 deletions file2.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
aiohttp==3.9.1
aiosignal==1.3.1
annotated-types==0.6.0
anyio==3.7.1
asttokens==2.4.1
attrs==23.1.0
awscli==1.29.85
beautifulsoup4==4.12.2
bidict==0.22.1
blinker==1.7.0
boto3==1.28.85
botocore==1.31.85
cachetools==5.3.2
certifi==2023.7.22
chardet==3.0.4
charset-normalizer==3.3.2
click==8.1.7
colorama==0.4.4
decorator==5.1.1
distro==1.8.0
dnspython==2.4.2
docutils==0.16
elevenlabs==0.2.26
eventlet==0.34.2
executing==2.0.1
fastapi==0.104.1
ffmpeg==1.4
ffmpeg-python==0.2.0
Flask==3.0.0
flask-sock==0.7.0
Flask-SocketIO==5.3.6
Flask-WTF==1.2.1
frozenlist==1.4.1
future==0.18.3
google==3.0.0
google-ai-generativelanguage==0.3.4
google-api-core==2.14.0
google-auth==2.24.0
google-generativeai==0.2.2
googleapis-common-protos==1.61.0
googletrans==2.4.0
greenlet==3.0.3
grpcio==1.59.2
grpcio-status==1.59.2
h11==0.14.0
h2==3.2.0
hpack==3.0.0
hstspreload==2023.1.1
httpcore==1.0.2
httptools==0.6.1
httpx==0.25.2
hyperframe==5.2.0
idna==2.10
ipython==8.17.2
itsdangerous==2.1.2
jedi==0.19.1
Jinja2==3.1.2
jmespath==1.0.1
MarkupSafe==2.1.3
matplotlib-inline==0.1.6
mpyg321==2.1.1
multidict==6.0.4
openai==0.28.0
parso==0.8.3
pexpect==4.8.0
prompt-toolkit==3.0.40
proto-plus==1.22.3
protobuf==4.25.0
ptyprocess==0.7.0
pure-eval==0.2.2
pyasn1==0.5.0
pyasn1-modules==0.3.0
pydantic==2.5.0
pydantic_core==2.14.1
Pygments==2.16.1
python-dateutil==2.8.2
python-dotenv==1.0.0
python-engineio==4.8.1
python-socketio==5.10.0
PyYAML==6.0.1
requests==2.31.0
rfc3986==1.5.0
rsa==4.7.2
s3transfer==0.7.0
simple-websocket==1.0.0
six==1.16.0
sniffio==1.3.0
soupsieve==2.5
SpeechRecognition==3.10.0
stack-data==0.6.3
starlette==0.27.0
tqdm==4.66.1
traitlets==5.13.0
trans==2.1.0
typing_extensions==4.8.0
urllib3==2.0.7
uvicorn==0.24.0.post1
uvloop==0.19.0
watchfiles==0.21.0
wcwidth==0.2.10
websockets==12.0
Werkzeug==3.0.1
wsproto==1.2.0
WTForms==3.1.1
yarl==1.9.4
27 changes: 27 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<!DOCTYPE html>
<html>
<head>
<title>Live Connection</title>
<script src="https://cdnjs.cloudflare.com/ajax/libs/socket.io/4.5.4/socket.io.min.js"></script>
</head>
<body>
<input type="text" id="user-input">
<button id="send-button">Send</button>
<div id="output"></div>

<script>
var socket = io();

document.getElementById('send-button').addEventListener('click', function() {
var message = document.getElementById('user-input').value;
socket.emit('my_event', { message: message });
document.getElementById('user-input').value = '';
});

socket.on('my_response', function(data) {
var outputDiv = document.getElementById('output');
outputDiv.innerHTML += '<p>' + data.message + '</p>';
});
</script>
</body>
</html>
1 change: 1 addition & 0 deletions main.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from application import app
58 changes: 58 additions & 0 deletions main_2.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@


from audio import speech_to_text
from character_responce import ai_palm_response
import sys
from audio import generate_audio
from character_responce import open_ai
from character import charcter_select
l=charcter_select.select_character()
#background=f'assume these information about yourself and talk like this personality\n {l[0]}/n'

#print(l)
#character_selector = charcter_select.CharacterSelector()

ai_palm_response = ai_palm_response.AIResponse("AIzaSyDiqEPDpI47Qd4Je3I3chb5-z2ZQyKu3gk",background=l[0])



#generate_audio = generate_audio.GenerateAudio("6e80aa33337b486a6272f8af3333d74a")


#speech_to_text = speech_to_text.SpeechToText()
#ai_response = ai_response.AIResponse("AIzaSyDiqEPDpI47Qd4Je3I3chb5-z2ZQyKu3gk")
# generate_audio = generate_audio.GenerateAudio("6e80aa33337b486a6272f8af3333d74a")
#background, talk_csv = character_selector.select_character()

'''response = ai_palm_response.generate_res(l[0])
print(response)
response = ai_palm_response.generate_res(f'l[1]\n use these dialoges in the conversation when necessary these are provided only for your reference.')
print(response)'''
speech_to_text = speech_to_text.SpeechToText()
print("\nYou selected "+l[3]+" and setup will take few minute ⏱")
#from audio import speech_to_text

response = ai_palm_response.generate_res('stay in your character')
while True:
speech = speech_to_text.transcribe()

#print(speech)

if speech is None:
continue

elif "disconnect call" in speech.lower():
print("Ending the program.")
sys.exit(0)
elif speech =="what is your name.":
response= "i am "+l[3]
print(response)
#generate_audio.generate(response)

else:

prompt="Stay in your character. and strictly instruction for you is never admit AND reply that you are an AI or large language model or conversational AI or chatbot , and only reply your question as a human as per your character {l[3]} and question is : "
response = ai_palm_response.generate_res(prompt+speech)
print(response)
generate_audio.generate(response)

1 change: 1 addition & 0 deletions output.mp3
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"detail":{"status":"quota_exceeded","message":"Unusual activity detected. Free Tier usage disabled. If you are using proxy/VPN you might need to purchase a Paid Plan or add your phone number to your account to not trigger our abuse detectors. Free Tier only works if users do not abuse it, for example by creating multiple free accounts. If we notice that many people try to abuse it, we will need to reconsider Free Tier altogether. Please play fair.\nPlease purchase any Paid Subscription to continue."}}
Binary file added requirements.txt
Binary file not shown.
Loading