MCPcopy Create free account
hub / github.com/HumeAI/hume-api-examples / main

Function main

evi/evi-python-quickstart/quickstart.py:41–62  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

39
40
41async def main() -> None:
42 load_dotenv()
43
44 HUME_API_KEY = os.getenv("HUME_API_KEY")
45 HUME_CONFIG_ID = os.getenv("HUME_CONFIG_ID")
46
47 client = AsyncHumeClient(api_key=HUME_API_KEY)
48 stream = Stream.new()
49
50 async with client.empathic_voice.chat.connect(config_id=HUME_CONFIG_ID) as socket:
51 print("WebSocket connection opened.")
52
53 async def handle_messages():
54 async for message in socket:
55 await on_message(message, stream)
56
57 await asyncio.gather(
58 handle_messages(),
59 MicrophoneInterface.start(socket, allow_user_interrupt=False, byte_stream=stream),
60 )
61
62 print("WebSocket connection closed.")
63
64
65if __name__ == "__main__":

Callers 1

quickstart.pyFile · 0.70

Calls 3

startMethod · 0.80
handle_messagesFunction · 0.70
connectMethod · 0.45

Tested by

no test coverage detected