0

I'm using a chat-conversational-react-description agent that has tools that can fetch information about 'product reviews', with an non-vector DB that stores documents for product reviews, text, 1-5 star rating, date, etc.

Given the following query "Provide list of reviews with low rating from the previous month". I would like to invoke a tool, that will query an the database and retrieve the data.

For langchain to resolve this query, and return the proper data.

The following needs to be extract from the input:

The review_query tool needs to be used, and the input needs to be pre-processed to breakdown of the query and extract the following parameters:

  • rating_score="low"
  • start_date="2023-05-01"
  • end_date="2023-06-01"

in order to get start_date and end_date there a need for get_current_date() ability.

The agent can have a tool, that handles the those types of queries easily, if it is provided with those arguments.

How do I approach the pre-process part, where I need to make the LLM extract those parameters from the input. And then invoke the tool, with those parameters?

Aviran
  • 5,160
  • 7
  • 44
  • 76

0 Answers0