added timer variable in env

This commit is contained in:
maglore9900 2024-10-03 22:30:31 -04:00
parent d95cca5b39
commit c7e632c0cf
3 changed files with 9 additions and 4 deletions

View File

@ -69,8 +69,12 @@ All of the easy configuration is done in the .env file. This section will explai
#LISTEN_MODEL will take whisper or google, whisper is the best option but requires additional setup with Nvidia drivers
`LISTEN_MODEL='google'`
#STREAM SPEAK URL is using the default url for Alltalk. If you dont have all talk you can ignore this, if you want to use a different service, simply replace the url
`STREAM_SPEAK_URL = 'http://127.0.0.1:7851/api/tts-generate'`
#TIME_LISTEN is the interval in seconds that the mic is running before adjusting for noise level. If you are talking and getting cut off by the mic cycling, you will want to make this longer. If you listen to music a lot you will want it around its default value of 10 seconds
`TIME_LISTEN = '10'`
#STREAM SPEAK URL is using the default url for Alltalk. If you dont have all talk you can ignore this, if you want to use a different service, simply replace the url `STREAM_SPEAK_URL = 'http://127.0.0.1:7851/api/tts-generate'`
#-----Spotify, if you want Max to be able to control spotify this is where you will put your credentials
`SPOTIFY_CLIENT_ID = ''`

View File

@ -15,7 +15,8 @@ OLLAMA_URL = 'http://localhost:11434'
CHARACTER = 'max'
#LISTEN_MODEL will take whisper or google, whisper is the best option but requires additional setup with Nvidia drivers
LISTEN_MODEL='google'
LISTEN_MODEL = 'google'
TIME_LIST = '10'
#STREAM SPEAK URL is using the default url for Alltalk. If you dont have all talk you can ignore this, if you want to use a different service, simply replace the url
STREAM_SPEAK_URL = 'http://127.0.0.1:7851/api/tts-generate'

View File

@ -27,7 +27,7 @@ else:
graph = agent.Agent(env,op)
while True:
text = graph.spk.listen()
text = graph.spk.listen(int(env("TIME_LISTEN")))
# if text:
# print(f"User: {text}")
if text and "hey" in text.lower() and env("CHARACTER").lower() in text.lower():