MCPcopy Index your code
hub / github.com/openai/openai-agents-python / prompt_with_fallback

Function prompt_with_fallback

examples/sandbox/tutorials/misc.py:158–165  ·  view source on GitHub ↗
(prompt: str, fallback: str)

Source from the content-addressed store, hash-verified

156
157
158def prompt_with_fallback(prompt: str, fallback: str) -> str:
159 if is_auto_mode():
160 return input_with_fallback(prompt, fallback).strip()
161
162 try:
163 return Prompt.ask(prompt).strip()
164 except (EOFError, KeyboardInterrupt):
165 return fallback
166
167
168def ask_user_questions(questions: list[Question]) -> list[QuestionAnswer]:

Callers 1

ask_user_questionsFunction · 0.85

Calls 2

is_auto_modeFunction · 0.90
input_with_fallbackFunction · 0.90

Tested by

no test coverage detected