You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The beckn-action-bot currently uses a custom function to generate a structured search request by identifying preferences and booking information from the conversation history.
The get_beckn_request_from_text function in services/ai.js generates the Beckn message object which in the full request looks like this.
{
"context": {
...
},
"message": {
...
}
}
This function is highly unreliable and produces erroneous results in most use cases.
There are three types of search requests that can potentially be generated in the scope of this issue
Note: The "context" object is generated via a different function that is outside the scope of this issue
Goals
Create test case to simulate a conversation that leads to an itinerary. A sample test case can be found at : /beckn-action-bot/tests/apis/bot.test.js : ‘Test cases for trip planning workflow’
Update get_beckn_request_from_text function to use instructor.js library instead of custom prompt to map specific data points obtained from the conversation history into a structured search request
Expected Outcome
The get_beckn_request_from_text should accurately generate the above three requests based on the conversation.
Acceptance Criteria
The get_beckn_request_from_text should generate a structured "Search by item name" request based on a conversation involving a retail purchase
The get_beckn_request_from_text should generate a structured "Search by location and tags" request based on a conversation involving discovering EV charging
The get_beckn_request_from_text should generate a structured "Search by location, time, and tags" request based on a conversation involving discovering hotels
Implementation Details
The application uses a NodeJS backend
It is expected to use Instructor.js
The text was updated successfully, but these errors were encountered:
Can I get a sample on the context that is passed to the function
instruction, context = (...), beckn_context(...)_schema={"profile":(...)}
I saw these variables being passed into the function but got no reference I could read up that shows a clear demo of what data goes in and what data goes out. Providing that could help me attempt fixing it
Example Input:
You are a cataloging expert that can identify tags and other elements from (... complete your prompt).
Chat History <enter history>
Users Current Query : <query>
Output Schema explanation
Example formats -> <example schema x3 for various scenarios>
If the proper samples of input data is provided in a text file or something I will try to help out with fixing your prompt and messing with a few regex.
I also need to add this: I might not be able to respond back fast enough with other projects that I have on my plate. So I cannot promise any assured outcome, just that I volunteer to help when I have free time.
@ravi-prakash-v Update get_beckn_request_from_text function to use instructor.js library instead of custom prompt to map specific data points obtained from the conversation history into a structured search request
Description
The beckn-action-bot currently uses a custom function to generate a structured
search
request by identifying preferences and booking information from the conversation history.The
get_beckn_request_from_text
function inservices/ai.js
generates the Becknmessage
object which in the full request looks like this.This function is highly unreliable and produces erroneous results in most use cases.
There are three types of search requests that can potentially be generated in the scope of this issue
Search by Item name
Search by Location and Tags
Search by Location, Time and Tags
Goals
/beckn-action-bot/tests/apis/bot.test.js : ‘Test cases for trip planning workflow’
get_beckn_request_from_text
function to use instructor.js library instead of custom prompt to map specific data points obtained from the conversation history into a structuredsearch
requestExpected Outcome
The
get_beckn_request_from_text
should accurately generate the above three requests based on the conversation.Acceptance Criteria
get_beckn_request_from_text
should generate a structured "Search by item name" request based on a conversation involving a retail purchaseget_beckn_request_from_text
should generate a structured "Search by location and tags" request based on a conversation involving discovering EV chargingget_beckn_request_from_text
should generate a structured "Search by location, time, and tags" request based on a conversation involving discovering hotelsImplementation Details
The text was updated successfully, but these errors were encountered: