Skip to content

Commit 4293bf3

Browse files
authored
More error handling (#256)
* add error handling for when agents don't submit a guess * CR * added more error handling * update
1 parent b6a3da3 commit 4293bf3

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

kaggle_environments/envs/llm_20_questions/llm_20_questions.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,12 +123,14 @@ def interpreter(state, env):
123123
active1.observation.category = category
124124
response = active1.action
125125
if not response:
126+
response = "none"
126127
active1.status = "ERROR"
127128
elif response.lower().__contains__("yes"):
128129
response = "yes"
129130
elif response.lower().__contains__("no"):
130131
response = "no"
131132
else:
133+
response = "maybe"
132134
active1.status = "ERROR"
133135
active1.observation.answers.append(response)
134136
inactive1.observation.answers.append(response)
@@ -179,12 +181,14 @@ def interpreter(state, env):
179181
active2.observation.category = category
180182
response = active2.action
181183
if not response:
184+
reponse = "none"
182185
active2.status = "ERROR"
183186
elif response.lower().__contains__("yes"):
184187
response = "yes"
185188
elif response.lower().__contains__("no"):
186189
response = "no"
187190
else:
191+
reponse = "maybe"
188192
active2.status = "ERROR"
189193
active2.observation.answers.append(response)
190194
inactive2.observation.answers.append(response)

0 commit comments

Comments
 (0)