[Feature] Added new structure with function calling to reduce flakiness and reduce transaction time #81
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Note: This is a slightly bigger PR so please raise as many questions as possible.
This PR, changes the way a beck transaction is identified and performed. It adds a few more improvements such as improved transaction time from ~2 minutes to under 1 min., added retries on failed responses and code cleanup.
Old flow : identify action > (If beckn action) > get context > get message > call api > compress response > format response
New flow : get response or perform action > perform actions > repeat
Features covered
These actions are configured under
config/GPT/tools.js
. More actions can be added to this if required.Screenshots/recordings
simple_booking.mp4
search_along_a_route.mp4
Testing
Testing with the whatsapp agent
Try it out yourself by interacting with the agent directly:
https://wa.me/+919335513882
Testing locally
README.md
filehttp://localhost:3001
, use the following commands to send messages to the agent to receive responses:Self checks
Reviewer Suggestions
This PR brings a new structure to the agent to improve reliability and speed. A few things may not work from the older version such as :
clearall
cheatcode is not workingAll of these pieces need to be added. Issues will be created for each one of them soon.