Skip to content

SmythOS Studio: Open-Source Visual AI Agent Builder and deployable runtime stack from SmythOS. Start with an intuitive drag-and-drop workspace, extend with custom code, and deploy your agents anywhere — local, cloud, or edge — with full governance and control.

logger

Ahmed Essam2fd8bbf4ccba
diff --git a/packages/app/src/backend/routes/api/agent/router.ts b/packages/app/src/backend/routes/api/agent/router.ts
index 593e75e3..4e9d19c1 100644
--- a/packages/app/src/backend/routes/api/agent/router.ts
+++ b/packages/app/src/backend/routes/api/agent/router.ts
@@ -1,8 +1,8 @@
import express from 'express';
-import * as userData from '../../../services/user-data.service';
-import * as openai from '../../../services/openai-helper';
-import { autoGenerateAvatarForAgent } from '../../../services/falai-helper';
import { includeTeamDetails } from '../../../middlewares/auth.mw';
+import { autoGenerateAvatarForAgent } from '../../../services/falai-helper';
+import * as openai from '../../../services/openai-helper';
+import * as userData from '../../../services/user-data.service';
const router = express.Router();
router.post('/', [includeTeamDetails], async (req, res) => {
@@ -23,6 +23,8 @@ router.post('/', [includeTeamDetails], async (req, res) => {
return res.status(400).json({ success: false, error: result.error.message });
}
+ const beforeAvatarGenerationTimestamp = Date.now();
+
try {
// #region TODO: move this responsibility to the caller
const existingAvatar = await userData.getAgentSettings(req, result.id, 'avatar');
@@ -33,6 +35,11 @@ router.post('/', [includeTeamDetails], async (req, res) => {
console.error('Error handling avatar generation:', error);
}
+ const afterAvatarGenerationTimestamp = Date.now();
+ console.log(
+ `Avatar generation took ${afterAvatarGenerationTimestamp - beforeAvatarGenerationTimestamp}ms`,
+ );
+
return res.send({ success: true, id: result.id, name: result.name, avatar });
});