-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #81 from beckn/add_function_calling
[Feature] Added new structure with function calling to reduce flakiness and reduce transaction time
- Loading branch information
Showing
43 changed files
with
827 additions
and
6,554 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,4 +5,4 @@ models/* | |
package*.json | ||
LICENSE | ||
*.md | ||
schemas/* | ||
config/schemas/* |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
export const TOOLS = [ | ||
{ | ||
type: "function", | ||
function: { | ||
name: "get_routes", | ||
description: "This function should only be used if the user specifically asks to get routes between a source and destination using google maps.", | ||
parameters: { | ||
type: "object", | ||
properties: { | ||
source:{ | ||
type:"string", | ||
description: "Source location in the format 'latitude,longitude' or 'text' from which route is to be fetched" | ||
}, | ||
destination:{ | ||
type:"string", | ||
description: "Destination location in the format 'latitude,longitude' or 'text' to which route is to be fetched" | ||
} | ||
} | ||
} | ||
} | ||
}, | ||
{ | ||
type: "function", | ||
function: { | ||
name: "select_route", | ||
description: "This function should only be used if the user has selected one of the routes shared by the assistant in the previous step. This function must not be used if the last response from assistant was not a list of routes between two points.", | ||
parameters: { | ||
type: "object", | ||
properties: { | ||
index:{ | ||
type:"number", | ||
description: "Index of the selected route." | ||
} | ||
} | ||
} | ||
} | ||
}, | ||
{ | ||
type: "function", | ||
function: { | ||
name: "perform_beckn_action", | ||
description: "If the user has indicated to search/find a product, select an item or add to cart, initialize an order or confirm on order.", | ||
parameters: { | ||
type: "object", | ||
properties: { | ||
action : { | ||
type: "string", | ||
description: "Action for which payload is to be fetched", | ||
enum: ["search", "select", "init", "confirm"] | ||
}, | ||
instruction: { | ||
type: "string", | ||
description: "Complete instructions about the action to be performed." | ||
} | ||
} | ||
} | ||
} | ||
} | ||
]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,38 +1,16 @@ | ||
{ | ||
"FULFILLMENT_STATUS_CODES": { | ||
"order-picked-up": { | ||
"message": "Your order's on its way!" | ||
}, | ||
"order-on-the-way": { | ||
"message": "Hang tight! Your order's cruising over to you." | ||
}, | ||
"order-delivered": { | ||
"message": "Package alert! Your order's been delivered." | ||
}, | ||
"ticket-issued": { | ||
"message": "All set! Your ticket's ready to go." | ||
}, | ||
"ticket-validated": { | ||
"message": "You're all good! Your ticket's been validated." | ||
}, | ||
"charging-started": { | ||
"message": "Juice up! Your charging session's begun." | ||
}, | ||
"charging-stopped": { | ||
"message": "Heads up! Your charging session's been paused." | ||
}, | ||
"charger-not-working": { | ||
"message": "Uh-oh, looks like there's a glitch with your charger ⚡😓. Need help finding another spot? 📍🔍" | ||
}, | ||
"charging-completed": { | ||
"message": "Charged and ready! Your battery's full." | ||
}, | ||
"checked-in": { | ||
"message": "Welcome! You've successfully checked in." | ||
}, | ||
"checked-out": { | ||
"message": "Safe travels! You've checked out." | ||
} | ||
"order-picked-up": "Your order's on its way!", | ||
"order-on-the-way": "Hang tight! Your order's cruising over to you.", | ||
"order-delivered": "Package alert! Your order's been delivered.", | ||
"ticket-issued": "All set! Your ticket's ready to go.", | ||
"ticket-validated": "You're all good! Your ticket's been validated.", | ||
"charging-started": "Juice up! Your charging session's begun.", | ||
"charging-stopped": "Heads up! Your charging session's been paused.", | ||
"charger-not-working": "Uh-oh, looks like there's a glitch with your charger ⚡😓. Need help finding another spot? 📍🔍", | ||
"charging-completed": "Charged and ready! Your battery's full.", | ||
"checked-in": "Welcome! You've successfully checked in.", | ||
"checked-out": "Safe travels! You've checked out." | ||
}, | ||
"ALL_MESSAGES": { | ||
"session_cleared": "Your session has been cleared! You're all set to start a new one.", | ||
|
@@ -49,26 +27,5 @@ | |
"missing_source": "Mind sharing the starting point for your journey?", | ||
"missing_destination": "Could you let us know your destination?", | ||
"route_list_description": "Here are some route options for you. Which one do you prefer?" | ||
}, | ||
"TEST_MESSAGES_USER": [ | ||
"---Days before the travel---", | ||
"Adam: Hey Alfred, you around?", | ||
"Adam: I’m hitting Yellowstone National Park on April 12th for 2 days. Got any places to stay?", | ||
"Adam: First one sounds awesome. Lets go with that", | ||
"Adam: You got it - John A. Smith, [email protected], (555) 123-4567.", | ||
"Adam: Sure, lets confirm!", | ||
|
||
"---On the date of travel---", | ||
"Adam: Alfred, can you find the best route to Yellowstone national park from Denver?", | ||
"Adam: lets go with Route 1", | ||
"Adam: Can you find ev chargers on the route?", | ||
"Adam: Lets go with Tesla Supercharger", | ||
|
||
|
||
"---Charging stopped due to an error---", | ||
"Adam: Yeah, let’s find another charger", | ||
"Adam: Let’s go with the second one.", | ||
"Adam: Sure thing, lets book it", | ||
"Adam: Yeah, let’s do it." | ||
] | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
export default { | ||
type: "object", | ||
properties: { | ||
order: { | ||
type: "object", | ||
description: "Describes a legal purchase order. It contains the complete details of the legal contract created between the buyer and the seller.", | ||
properties: { | ||
fulfillments: { | ||
description: "The fulfillments involved in completing this order.", | ||
type: "array", | ||
items: { | ||
type: "object", | ||
description: "Describes how a an order will be rendered/fulfilled to the end-customer.", | ||
properties: { | ||
id: { | ||
type: "string", | ||
description: "Unique reference ID to the fulfillment of an order based on fulfillments provided in the init response." | ||
}, | ||
customer: { | ||
type: "object", | ||
description: "The person that will ultimately receive the order", | ||
properties: { | ||
person: { | ||
type: "object", | ||
description: " Describes a person as any individual ", | ||
properties: { | ||
name: { | ||
type: "string", | ||
description: "Name of the person" | ||
} | ||
}, | ||
required: ["name"] | ||
}, | ||
contact: { | ||
type: "object", | ||
description: "Describes the contact information of an entity", | ||
properties: { | ||
phone: { | ||
type: "string", | ||
description: "Phone number of the contact person" | ||
}, | ||
email: { | ||
type: "string", | ||
description: "Email address of the contact person" | ||
} | ||
}, | ||
required: ["phone", "email"] | ||
} | ||
}, | ||
required: ["person", "contact"] | ||
} | ||
}, | ||
required: ["customer"] | ||
} | ||
} | ||
}, | ||
required: ["items", "billing", "fulfillments"] | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
export default { | ||
type: "object", | ||
properties: { | ||
order: { | ||
type: "object", | ||
description: "Describes a legal purchase order. It contains the complete details of the legal contract created between the buyer and the seller.", | ||
properties: { | ||
billing: { | ||
description: "Describes the billing details of an entity.<br>This has properties like name,organization,address,email,phone,time,tax_number, created_at,updated_at", | ||
type: "object", | ||
properties: { | ||
name: { | ||
type: "string", | ||
description: "Name of the billable entity" | ||
}, | ||
email: { | ||
type: "string", | ||
description: "Email address where the bill is sent to" | ||
}, | ||
phone: { | ||
type: "string", | ||
description: "Phone number of the billable entity" | ||
} | ||
}, | ||
required: ["name", "email", "phone"] | ||
} | ||
}, | ||
required: ["items", "billing"] | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.