Skip to content

Commit d554ab0

Browse files
address comments
1 parent a46ddc6 commit d554ab0

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

src/agentlab/agents/hint_use_agent/generic_agent.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -271,6 +271,9 @@ def _init_hints_index(self):
271271
"""Initialize the block."""
272272
try:
273273
if self.flags.hint_type == "docs":
274+
if self.flags.hint_index_type == "direct":
275+
print("WARNING: Hint index type 'direct' is not supported for docs. Using 'sparse' instead.")
276+
self.flags.hint_index_type = "sparse"
274277
if self.flags.hint_index_type == "sparse":
275278
import bm25s
276279

@@ -323,18 +326,19 @@ def _get_task_hints(self) -> list[str]:
323326
return []
324327

325328
if self.flags.hint_type == "docs":
329+
if self.flags.hint_index_type == "direct":
330+
print("WARNING: Hint index type 'direct' is not supported for docs. Using 'sparse' instead.")
331+
self.flags.hint_index_type = "sparse"
326332
if not hasattr(self, "hint_index"):
327-
print("Initializing hint index new time")
328-
# @patricebechard It seems _.init() method is missing do we still need it?
329-
# self._init()
333+
print("WARNING: Hint index not initialized. Initializing now.")
334+
self._init_hints_index()
330335
if self.flags.hint_query_type == "goal":
331336
query = self.obs_history[-1]["goal_object"][0]["text"]
332337
elif self.flags.hint_query_type == "llm":
333338
queries, _ = self._get_queries()
334339
# HACK: only 1 query supported
335340
query = queries[0]
336341
else:
337-
# @patricebechard: This raises an error with the default value 'direct'
338342
raise ValueError(f"Unknown hint query type: {self.flags.hint_query_type}")
339343

340344
print(f"Query: {query}")

0 commit comments

Comments
 (0)