MCPcopy Create free account
hub / github.com/Paper2Poster/Paper2Poster / get_input

Method get_input

camel/human.py:77–95  ·  view source on GitHub ↗

r"""Gets the input from the user. Returns: str: The user's input.

(self)

Source from the content-addressed store, hash-verified

75 self.options_dict[str(index + 1)] = option
76
77 def get_input(self) -> str:
78 r"""Gets the input from the user.
79
80 Returns:
81 str: The user's input.
82 """
83 while True:
84 human_input = input(
85 self.logger_color
86 + f"Please enter your choice ([1-{len(self.options_dict)}]): "
87 )
88 print("\n")
89 if human_input in self.options_dict:
90 break
91 print_text_animated(
92 self.logger_color + "\n> Invalid choice. Please try again.\n"
93 )
94
95 return human_input
96
97 def parse_input(self, human_input: str) -> str:
98 r"""Parses the user's input and returns a `BaseMessage` object.

Callers 1

reduce_stepMethod · 0.95

Calls 1

print_text_animatedFunction · 0.90

Tested by

no test coverage detected