Setting up
If you haven’t already, set up a cluster and project scaffolding by following
the quick start.
Connecting a service with TypeScript
1
Create a service file
Start by creating a 
delivery.service.ts
inside the src/services
directory.
2
Write service functions
Let’s create a toy delivery service with two main functions:
makeDelivery
: Places a delivery for a given order id.checkDeliveryStatus
: Checks the status of a delivery by order id.
3
Connect functions to Inferable
Wire up the functions so AI can execute them alongside other services. Append this code to
delivery.service.ts
:4
Start the service
Start the service with:You can verify that the services are running by doing:
5
Test the new function
Try out your new functions via the Assistant UI with this command:
Can you make an order for two lightsabers, and deliver them to 742 Evergreen Terrace, Springfield?Inferable should execute multiple steps:
- Check the inventory
- Make the order
- Register a delivery for the order (using our new code)