Find answers from the community

Updated 2 years ago

hi team when using LLMMultiSelector i m

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