Private
Optional
_descriptionPrivate
Optional
_keywordsPrivate
_methodsPrivate
_nameGet a method by name.
The name of the method.
The method or undefined if it doesn't exist.
Here's an example of how to get a method:
hotelService.getMethod('reserveHotelRoom');
Register a method to the service.
Service with the new method registered. Use this to chain method registrations.
Here's an example of how to register a method:
const reserveHotelRoomMethod = new Method({
input: {
type: 'object',
properties: { beginDate: {type:'string'}, endDate: {type:'string'} },
},
output: { type: 'object', properties: { orderId: {type:'string'} } },
handler: async (input: { beginDate: string; endDate: string }) => {
return { orderId: '123' };
},
});
const hotelService = new Service({ name: 'hotel' })
.registerMethod('reserveHotelRoom', reserveHotelRoomMethod);
hotelService.reserveHotelRoom.handler({
beginDate: '2020-01-01', endDate: '2020-01-02'
});
Generated using TypeDoc
This is the definition of a service that can be called by the LLM. The methods are defined by a Method. The services can be added to a Chat.
Example
Here's an example of how to create a service: