Replies: 1 comment 3 replies
-
I'm not entirely sure what you're trying to do. Are you trying to create a retrieval chain that uses tools to adjust the questions the user answers, OR are you trying to allow the user to ask a question and have that question be answered by either the search tool, retrieval, or the WorldNewsTool as appropriate? If it's the latter (i.e. letting the user ask a question and have it answered by the most appropriate of those three sources), you should set up an agent instead. This is fairly simple to do and the docs on it are pretty straightforward and should be enough to help you through it. You could bind the search tool, WorldNewsTool, and a retrieval tool (you can generate this easily with create_retriever_tool) to the LLM, and then have the agent run queries through that LLM. If it's the former (i.e. you want the tools to modify possibly modify the user's question and then perform retrieval), then I suspect the issue is that you need to adjust the output of your tools. For instance, the Search tool as it's presently written, would just return an answer (as opposed to a prompt that might be helpful for retrieval) and the description is also confusing enough that the LLM probably doesn't understand what it's meant to use it for. You'd also probably need to bind the tools to the condense_question_llm or just write some custom chain to handle this. Even if you're just trying to do the former, using an agent is probably still the easiest way to do this. The only difficulty would be that the agent wouldn't necessarily always use the retriever, if that was a goal of yours. |
Beta Was this translation helpful? Give feedback.
-
I have a custom chatbot setup using
ConversationalRetrievalChain
, but so far I'm struggling to integratetools
within it. If I go with RAG approach I don't get as accurate results as my previous setup. I would appreciate any help here. Thanks.This is my current attempt, and it does normal qa seemlessly, but for the tasks which requires tools, it sorts of hangs up. I'm not sure if this is even the correct approach.
Beta Was this translation helpful? Give feedback.
All reactions