MCPcopy
hub / github.com/openai/openai-agents-python / input_with_fallback

Function input_with_fallback

examples/auto_mode.py:19–24  ·  view source on GitHub ↗

Return the fallback text in auto mode, otherwise defer to input().

(prompt: str, fallback: str)

Source from the content-addressed store, hash-verified

17
18
19def input_with_fallback(prompt: str, fallback: str) -> str:
20 """Return the fallback text in auto mode, otherwise defer to input()."""
21 if is_auto_mode():
22 print(f"[auto-input] {prompt.strip()} -> {fallback}")
23 return fallback
24 return input(prompt)
25
26
27def confirm_with_fallback(prompt: str, default: bool = True) -> bool:

Callers 15

mainFunction · 0.90
_pick_scenarioFunction · 0.90
prompt_with_fallbackFunction · 0.90
mainFunction · 0.90
mainFunction · 0.90
mainFunction · 0.90
mainFunction · 0.90
mainFunction · 0.90
mainFunction · 0.90
mainFunction · 0.90
mainFunction · 0.90
mainFunction · 0.90

Calls 1

is_auto_modeFunction · 0.85

Tested by

no test coverage detected