Skip to content

Commit

Permalink
Update rigobotContext.js
Browse files Browse the repository at this point in the history
  • Loading branch information
tommygonzaleza authored Nov 26, 2024
1 parent 33fd5e6 commit 8ea2a1b
Showing 1 changed file with 12 additions and 10 deletions.
22 changes: 12 additions & 10 deletions src/utils/rigobotContext.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
export const generateUserContext = (user) => {
const { first_name, last_name, date_joined, roles, settings } = user;
let ai_context = '';
/* eslint-disable camelcase */

if (first_name) ai_context += "The user's first name is " + first_name + '. ';
if (last_name) ai_context += "The user's last name is " + last_name + '. ';
if (date_joined) ai_context += 'The user joined on ' + date_joined + '. ';
if (roles) roles.forEach((role) => ai_context += 'The user has the role of ' + role.role + ' in the academy of ' + role.academy.name + '. ');
if (settings) ai_context += 'The user has the following settings: Default language: ' + settings.lang + '.';
export const generateUserContext = (user) => {
const { first_name, last_name, date_joined, roles, settings } = user;
let ai_context = '';

if (first_name) ai_context += `The user's first name is ${first_name}. `;
if (last_name) ai_context += `The user's last name is ${last_name}. `;
if (date_joined) ai_context += `The user joined on ${date_joined}. `;
if (roles) roles.forEach((role) => ai_context += `The user has the role of ${role.role} in the academy of ${role.academy.name}. `);
if (settings) ai_context += `The user has the following settings: Default language: ${settings.lang}.`;

return ai_context;
};
return ai_context;
};

0 comments on commit 8ea2a1b

Please sign in to comment.