Replies: 3 comments
-
🤖 Hi, You're correct that the If you need to access the selected tool/engine, one possible solution could be to modify the class RouterQueryEngine(BaseQueryEngine):
# existing code...
def _query(self, query: Query) -> Any:
# existing code...
self.last_selected_engine_ind = self._selector.select(query, self._query_engine_tools)
selected_tool = self._query_engine_tools[self.last_selected_engine_ind]
# existing code...
def _aquery(self, query: Query) -> Any:
# existing code...
self.last_selected_engine_ind = self._selector.select(query, self._query_engine_tools)
selected_tool = self._query_engine_tools[self.last_selected_engine_ind]
# existing code... In this example, Please note that this is a simple example and may not cover all use cases or edge cases. You may need to adjust this code to fit your specific needs. I hope this helps! Let me know if you have any other questions. SourcesThis response is meant to be useful and save you time. It is not meant to be a precise solution, but rather a starting point for your own research. Help me be more useful! Please leave a 👍 if this is helpful and 👎 if it is irrelevant. If you want to continue the conversation, start your reply with @dosu-bot. |
Beta Was this translation helpful? Give feedback.
-
Such approach requires to sync custom implementation with any changes made |
Beta Was this translation helpful? Give feedback.
-
@h1Logic I think ideally this would get logged either in the response object ( |
Beta Was this translation helpful? Give feedback.
-
Question Validation
Question
Hi,
what is recommended way to access selected tool/engine in
RouterQueryEngine
? As far as i can tell it's only logged vialogger.info()
but it's not stored anywhere. It would be great if either it can be returned or stored asproperty
(or example 'last_selected_engine_ind`).Thanks!
Beta Was this translation helpful? Give feedback.
All reactions