mirror of
https://github.com/maglore9900/max_headroom.git
synced 2025-06-06 19:45:31 +00:00
.
This commit is contained in:
parent
5e52804933
commit
dcadac9b19
16
main.py
16
main.py
@ -1,17 +1,19 @@
|
|||||||
from modules import adapter, speak, spotify
|
from modules import agent, speak
|
||||||
|
import asyncio
|
||||||
|
|
||||||
|
loop = asyncio.new_event_loop()
|
||||||
|
asyncio.set_event_loop(loop)
|
||||||
|
|
||||||
|
|
||||||
sp = speak.Speak()
|
sp = speak.Speak()
|
||||||
ad = adapter.Adapter("openai")
|
graph = agent.Agent("openai")
|
||||||
spot = spotify.Spotify()
|
|
||||||
|
|
||||||
|
|
||||||
while True:
|
while True:
|
||||||
text = sp.listen()
|
text = sp.listen()
|
||||||
if text and "max" in text.lower():
|
if text and "max" in text.lower():
|
||||||
response = ad.chat(text)
|
response = loop.run_until_complete(graph.invoke_agent(text))
|
||||||
|
if response:
|
||||||
# sp.max_headroom(response)
|
sp.glitch_stream_output(response)
|
||||||
sp.glitch_stream_output(response)
|
|
||||||
|
|
||||||
print("Listening again...")
|
print("Listening again...")
|
19
main2.py
19
main2.py
@ -1,19 +0,0 @@
|
|||||||
from modules import agent, speak
|
|
||||||
import asyncio
|
|
||||||
|
|
||||||
loop = asyncio.new_event_loop()
|
|
||||||
asyncio.set_event_loop(loop)
|
|
||||||
|
|
||||||
|
|
||||||
sp = speak.Speak()
|
|
||||||
graph = agent.Agent("openai")
|
|
||||||
|
|
||||||
|
|
||||||
while True:
|
|
||||||
text = sp.listen()
|
|
||||||
if text and "max" in text.lower():
|
|
||||||
response = loop.run_until_complete(graph.invoke_agent(text))
|
|
||||||
if response:
|
|
||||||
sp.glitch_stream_output(response)
|
|
||||||
|
|
||||||
print("Listening again...")
|
|
Loading…
x
Reference in New Issue
Block a user