Last, I left off. We created our Agent. It was simple but enough to give you something to start with.
In this episode, we create a simple Rest API for our Agent. Not enough for production, but enough to point you in the right direction. For the remainder of the article, I assume you know how to use JavaScript or TypeScript and briefly cover what I changed in the project.
Finished Example:
https://github.com/Moikapy/xander/tree/api
For this implementation, we will use Express and Body-parser. Our server will use Express, and Body-parser will process body data sent via HTTP.
bash
# Dependencies
npm i express body-parser --saveI started by creating the chat route.
The bulk of this logic comes from the main.ts file from the last example.
You can update the routes to suit your use case; in this example, mine will be: '/api/v1/chat'. I will request the model, temperature, system_mesage, max_tokens, and prompt via the body of our rest call.
You can alw…

Comments
Nothing yet. Say the first thing.
Sign in to join the conversation.