feat: first pass, bedrock chat. note: AgentClient is returning agents as conversation.endpoint

This commit is contained in:
Danny Avila 2024-08-31 22:16:11 -04:00
parent 120a6a55fb
commit 60ee12d3e8
No known key found for this signature in database
GPG key ID: 2DD9CC89B9B50364
20 changed files with 270 additions and 23 deletions

View file

@ -0,0 +1,35 @@
const express = require('express');
const router = express.Router();
const {
setHeaders,
handleAbort,
// validateModel,
// validateEndpoint,
buildEndpointOption,
} = require('~/server/middleware');
const { initializeClient } = require('~/server/services/Endpoints/bedrock');
const AgentController = require('~/server/controllers/agents/request');
router.post('/abort', handleAbort());
/**
* @route POST /
* @desc Chat with an assistant
* @access Public
* @param {express.Request} req - The request object, containing the request data.
* @param {express.Response} res - The response object, used to send back a response.
* @returns {void}
*/
router.post(
'/',
// validateModel,
// validateEndpoint,
buildEndpointOption,
setHeaders,
async (req, res, next) => {
await AgentController(req, res, next, initializeClient);
},
);
module.exports = router;