diff --git a/src/agentlab/agents/hint_use_agent/generic_agent.py b/src/agentlab/agents/hint_use_agent/generic_agent.py index afc688ed..f4010f70 100644 --- a/src/agentlab/agents/hint_use_agent/generic_agent.py +++ b/src/agentlab/agents/hint_use_agent/generic_agent.py @@ -271,6 +271,11 @@ def _init_hints_index(self): """Initialize the block.""" try: if self.flags.hint_type == "docs": + if self.flags.hint_index_type == "direct": + print( + "WARNING: Hint index type 'direct' is not supported for docs. Using 'sparse' instead." + ) + self.flags.hint_index_type = "sparse" if self.flags.hint_index_type == "sparse": import bm25s @@ -323,10 +328,14 @@ def _get_task_hints(self) -> list[str]: return [] if self.flags.hint_type == "docs": + if self.flags.hint_index_type == "direct": + print( + "WARNING: Hint index type 'direct' is not supported for docs. Using 'sparse' instead." + ) + self.flags.hint_index_type = "sparse" if not hasattr(self, "hint_index"): - print("Initializing hint index new time") - # @patricebechard It seems _.init() method is missing do we still need it? - # self._init() + print("WARNING: Hint index not initialized. Initializing now.") + self._init_hints_index() if self.flags.hint_query_type == "goal": query = self.obs_history[-1]["goal_object"][0]["text"] elif self.flags.hint_query_type == "llm": @@ -334,7 +343,6 @@ def _get_task_hints(self) -> list[str]: # HACK: only 1 query supported query = queries[0] else: - # @patricebechard: This raises an error with the default value 'direct' raise ValueError(f"Unknown hint query type: {self.flags.hint_query_type}") print(f"Query: {query}")