MCPcopy Create free account

hub / github.com/NickTikhonov/shuo / functions

Functions148 in github.com/NickTikhonov/shuo

↓ 50 callersFunction_c
Wrap text in color codes.
shuo/log.py:53
↓ 42 callersMethodinfo
(self, msg: str)
shuo/log.py:295
↓ 35 callersMethodget
Get a connected TTS service with the given callbacks. Returns a warm connection if available (and not stale), otherwise bloc
shuo/services/tts_pool.py:77
↓ 33 callersFunctionprocess_event
Pure state machine: (State, Event) -> (State, Actions) With Flux, this is just a simple router: - MediaEvent -> feed audio to Flu
shuo/state.py:22
↓ 20 callersMethoderror
Log an error (red).
shuo/log.py:239
↓ 10 callersMethodcancel
Cancel ongoing generation.
shuo/services/llm.py:64
↓ 5 callersFunction_text_outline
White outline effect for text readability over the map.
scripts/service_map.py:93
↓ 4 callersFunction_ms_since
Milliseconds elapsed since t0.
shuo/agent.py:29
↓ 4 callersMethodbegin
Begin a named span.
shuo/tracer.py:77
↓ 4 callersMethoddebug
(self, msg: str)
shuo/log.py:292
↓ 4 callersMethodend
End a named span.
shuo/tracer.py:85
↓ 4 callersFunctionget_logger
Get a logger instance.
shuo/log.py:95
↓ 3 callersMethodcancel_turn
Cancel current turn, preserve history.
shuo/agent.py:126
↓ 3 callersMethodconnected
(self)
shuo/log.py:269
↓ 3 callersMethodsend
Send text chunk for synthesis.
shuo/services/tts.py:93
↓ 3 callersMethodstop_and_clear
Stop playback immediately and clear Twilio's buffer.
shuo/services/player.py:85
↓ 2 callersMethod_cleanup
Clean up resources.
shuo/services/tts.py:142
↓ 2 callersMethod_cleanup
Clean up resources.
shuo/services/flux.py:104
↓ 2 callersMethod_playback_loop
Independent loop that drips audio at ~20ms intervals.
shuo/services/player.py:111
↓ 2 callersFunction_quote
Wrap text in quotes with color.
shuo/log.py:58
↓ 2 callersMethod_trigger_fill
Signal the fill loop to check pool levels.
shuo/services/tts_pool.py:128
↓ 2 callersMethodcancelled
(self)
shuo/log.py:277
↓ 2 callersMethoddisconnected
(self)
shuo/log.py:274
↓ 2 callersMethodflush
Force synthesis of any buffered text.
shuo/services/tts.py:107
↓ 2 callersFunctionload_trace
(path: Path)
scripts/visualize.py:53
↓ 2 callersFunctionmake_outbound_call
Initiate an outbound call using Twilio. Args: to_number: Phone number to call in E.164 format (+1234567890) Returns
shuo/services/twilio_client.py:18
↓ 2 callersMethodmark
Record a point-in-time marker.
shuo/tracer.py:97
↓ 2 callersMethodstart
Start generating a response.
shuo/services/llm.py:53
↓ 2 callersMethodstart
Open WebSocket connection to ElevenLabs.
shuo/services/tts.py:54
↓ 1 callersFunction_color
(m: str)
scripts/bench_chart.py:33
↓ 1 callersMethod_evict_stale
Remove connections that have been idle past TTL.
shuo/services/tts_pool.py:168
↓ 1 callersMethod_fill_loop
Background loop that keeps the pool at target size.
shuo/services/tts_pool.py:132
↓ 1 callersMethod_generate
Generate response and stream tokens.
shuo/services/llm.py:78
↓ 1 callersMethod_handle_message
Parse and handle ElevenLabs response.
shuo/services/tts.py:178
↓ 1 callersFunction_make_clients
Build provider → AsyncOpenAI client map.
shuo/server.py:139
↓ 1 callersFunction_measure_ttft
Single TTFT measurement in milliseconds. Opens a streaming completion, records time-to-first-content-token, then closes the stream immed
shuo/server.py:154
↓ 1 callersMethod_receive_loop
Background task to receive audio chunks.
shuo/services/tts.py:161
↓ 1 callersFunction_render_turn
Render a single turn on one subplot.
scripts/visualize.py:145
↓ 1 callersMethod_send_audio
Send a single audio chunk to Twilio.
shuo/services/player.py:137
↓ 1 callersMethod_send_clear
Send clear message to Twilio to flush audio buffer.
shuo/services/player.py:148
↓ 1 callersFunction_short_id
Truncate long call IDs for display.
scripts/visualize.py:79
↓ 1 callersMethodaction
Log an outgoing action.
shuo/log.py:200
↓ 1 callersMethodbegin_turn
Start a new turn, returns turn number.
shuo/tracer.py:66
↓ 1 callersMethodbind
Rebind callbacks (used by connection pool to assign per-turn handlers).
shuo/services/tts.py:45
↓ 1 callersMethodcall_initiated
(cls, sid: str)
shuo/log.py:129
↓ 1 callersMethodcall_initiating
(cls, phone: str)
shuo/log.py:125
↓ 1 callersMethodcancel
Abort connection immediately.
shuo/services/tts.py:136
↓ 1 callersFunctioncheck_environment
Check that all required environment variables are set.
main.py:35
↓ 1 callersMethodcleanup
Final cleanup when call ends.
shuo/agent.py:151
↓ 1 callersMethodevent
Log an incoming event.
shuo/log.py:152
↓ 1 callersFunctionfetch_trace
Fetch trace JSON from a remote URL.
scripts/visualize.py:58
↓ 1 callersFunctionfind_latest_trace
()
scripts/visualize.py:64
↓ 1 callersFunctionmain
Main entry point.
main.py:75
↓ 1 callersFunctionmain
CLI entry point.
scripts/visualize.py:296
↓ 1 callersFunctionmake_chart
(data: dict, save_path: Optional[str] = None)
scripts/bench_chart.py:24
↓ 1 callersFunctionmake_map
(save_path: str = None)
scripts/service_map.py:98
↓ 1 callersMethodmark_tts_done
Signal that TTS is complete - no more chunks coming.
shuo/services/player.py:69
↓ 1 callersFunctionparse_twilio_message
Parse raw Twilio WebSocket message into typed Event.
shuo/services/twilio_client.py:50
↓ 1 callersFunctionread_twilio
Background task to read from Twilio and push to event queue.
shuo/conversation.py:77
↓ 1 callersFunctionrender_trace
Render a trace as a Gantt chart.
scripts/visualize.py:86
↓ 1 callersFunctionrun_conversation_over_twilio
Main event loop for a single call. 1. Create shared event queue 2. Create Flux service (always-on STT + turn detection) 3. Start Twi
shuo/conversation.py:41
↓ 1 callersMethodsave
Write trace data to /tmp/shuo/<call_id>.json.
shuo/tracer.py:116
↓ 1 callersMethodsend
Send audio chunk to Deepgram Flux.
shuo/services/flux.py:88
↓ 1 callersMethodsend_chunk
Add an audio chunk to the playback queue.
shuo/services/player.py:62
↓ 1 callersMethodserver_ready
(cls, url: str)
shuo/log.py:121
↓ 1 callersMethodserver_starting
(cls, port: int)
shuo/log.py:117
↓ 1 callersFunctionsetup_logging
Configure logging for the application.
shuo/log.py:78
↓ 1 callersMethodshutdown
(cls)
shuo/log.py:143
↓ 1 callersMethodstart
Start the playback loop.
shuo/services/player.py:50
↓ 1 callersMethodstart
Start the pool and begin pre-connecting.
shuo/services/tts_pool.py:69
↓ 1 callersMethodstart
Connect to Deepgram Flux (always-on for the duration of the call).
shuo/services/flux.py:50
↓ 1 callersMethodstart_turn
Start a new agent turn.
shuo/agent.py:90
↓ 1 callersMethodstop
Shut down pool and clean up all connections.
shuo/services/tts_pool.py:111
↓ 1 callersMethodstop
Disconnect from Deepgram Flux.
shuo/services/flux.py:98
↓ 1 callersMethodtransition
Log a phase transition (magenta).
shuo/log.py:229
↓ 1 callersMethodwebsocket_connected
(cls)
shuo/log.py:135
↓ 1 callersMethodwebsocket_disconnected
(cls)
shuo/log.py:139
Method__init__
(self, verbose: bool = False)
shuo/log.py:148
Method__init__
(self, service_name: str)
shuo/log.py:264
Method__init__
( self, websocket: WebSocket, stream_sid: str, on_done: Callable[[], None],
shuo/agent.py:43
Method__init__
(self)
shuo/tracer.py:62
Method__init__
( self, on_token: Callable[[str], Awaitable[None]], on_done: Callable[[], Awaitable[No
shuo/services/llm.py:25
Method__init__
( self, websocket: WebSocket, stream_sid: str, on_done: Optional[Callable[[],
shuo/services/player.py:30
Method__init__
(self, pool_size: int = 1, ttl: float = 8.0)
shuo/services/tts_pool.py:55
Method__init__
( self, on_audio: Callable[[str], Awaitable[None]], on_done: Callable[[], Awaitable[No
shuo/services/tts.py:26
Method__init__
( self, on_end_of_turn: Callable[[str], Awaitable[None]], on_start_of_turn: Callable[[
shuo/services/flux.py:29
Function_fmt_ms
Format axis tick as integer ms or seconds.
scripts/visualize.py:72
Function_handle_sigterm
Railway (and Docker) send SIGTERM before killing the container. We stop accepting new calls and wait for active ones to finish.
main.py:107
Function_noop_audio
(_audio: str)
shuo/services/tts_pool.py:30
Function_noop_done
()
shuo/services/tts_pool.py:34
Method_on_error
Handle Deepgram errors.
shuo/services/flux.py:158
Method_on_llm_done
LLM finished -> flush TTS.
shuo/agent.py:172
Method_on_llm_token
LLM produced a token -> feed to TTS.
shuo/agent.py:158
Method_on_message
Handle Flux messages -- parse TurnInfo events.
shuo/services/flux.py:126
Method_on_playback_done
Player finished -> turn is complete.
shuo/agent.py:202
Method_on_tts_audio
TTS produced audio -> send to player.
shuo/agent.py:179
Method_on_tts_done
TTS finished -> tell player no more chunks coming.
shuo/agent.py:195
Methodavailable
Number of warm connections ready to dispense.
shuo/services/tts_pool.py:65
Functionbench_ttft
Benchmark TTFT across OpenAI-compatible models. Usage: curl https://your-server/bench/ttft curl https://your-server/bench/tt
shuo/server.py:201
Methodcancel_turn
Mark turn as cancelled and end all open spans at current time.
shuo/tracer.py:105
next →1–100 of 148, ranked by callers