MCPcopy Index your code
hub / github.com/geekcomputers/Python / typed_loop

Function typed_loop

JARVIS/cli.py:146–167  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

144
145
146def typed_loop():
147 say("Type mode is active. Type /voice to return to listening.")
148 while True:
149 try:
150 user_input = input("You: ").strip()
151 except (EOFError, KeyboardInterrupt):
152 print()
153 say("Goodbye.")
154 break
155 if not user_input:
156 continue
157 if should_exit(user_input):
158 say("Goodbye.")
159 break
160 if normalize_text(user_input) in {"/voice", "voice", "listen", "listening"}:
161 voice_loop()
162 break
163 if normalize_text(user_input) in {"/refresh", "refresh apps"}:
164 apps = build_application_index()
165 say(f"Safe app index refreshed: {len(apps)} apps found.")
166 continue
167 handle_and_say(user_input)
168
169
170def main(argv=None):

Callers 2

voice_loopFunction · 0.85
mainFunction · 0.85

Calls 6

sayFunction · 0.85
should_exitFunction · 0.85
normalize_textFunction · 0.85
voice_loopFunction · 0.85
build_application_indexFunction · 0.85
handle_and_sayFunction · 0.85

Tested by

no test coverage detected