Find answers from the community

Updated 2 years ago

hi team when using LLMMultiSelector i m

At a glance

The community member is experiencing an error when using LLMMultiSelector, where they are getting a ValueError stating that there are 3 selections and they should use .inds. They have defined 3 tools - list_tool, vector_tool, and empty_tool - and it works fine with LLMSingleSelector.

In the comments, another community member explains that RouterQueryEngine is new and currently only supports routing to a single option using LLMSingleSelector. They mention that support for multiple selection and combining the responses will be added soon.

The third community member asks if the integration with Langchain as a tool to be retrieved is planned, and also inquires about how to properly set the summary for an empty index to use the empty_tool only when the data is not available in the index.

hi team when using LLMMultiSelector i'm getting a weird error

File "/Users/sheresaidon/virtualenvs/bright-black-ai-chat-template/lib/python3.10/site-packages/llama_index/selectors/types.py", line 19, in ind
raise ValueError(
ValueError: There are 3 selections, please use .inds.

i have defined 3 tools as below and it works fine with SingleSelector
query_engine = RouterQueryEngine(
selector=LLMMultiSelector.from_defaults(
service_context=service_context),
query_engine_tools=[
list_tool,
vector_tool,
empty_tool
]

)
d
s
3 comments
hey @shere, RouterQueryEngine is quite new and we only added support for routing to a single option for now (i.e. via LLMSingleSelector`
support for multiple selection and then combining the response from them will be added soon!
@disiok got it thanks! is this going to integrate with langchain as a tool to be retrieved? also i'm trying to add a tool for an empty index as well but i don't know how to properly set the summary so that only if the data is not available in the index to use the empty tool? any thoughts?

# define tools
list_tool = QueryEngineTool.from_defaults(
query_engine=list_query_engine,
description='Useful for multiple questions',
)

vector_tool = QueryEngineTool.from_defaults(
query_engine=vector_query_engine,
description='Useful for answering 1-2 questions.',
)
# empty_tool = QueryEngineTool.from_defaults(
# query_engine=empty_query_engine,
# description='Useful for retrieving external knowledge and information not provided in the context.',
# )



query_engine = RouterQueryEngine(
selector=LLMSingleSelector.from_defaults(
service_context=service_context),
query_engine_tools=[
list_tool,
vector_tool
# ,
# empty_tool
]

)
Add a reply
Sign up and join the conversation on Discord