-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #35 from juancarlosfarah/main
feat: make chatbot configurable (#1)
- Loading branch information
Showing
29 changed files
with
1,753 additions
and
638 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -40,3 +40,6 @@ yarn-debug.log* | |
cypress/screenshots/ | ||
cypress/videos/ | ||
cypress/downloads/ | ||
|
||
#vite | ||
vite.config.ts.timestamp-* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
compressionLevel: mixed | ||
|
||
defaultSemverRangePrefix: "" | ||
defaultSemverRangePrefix: '' | ||
|
||
enableGlobalCache: false | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
<!DOCTYPE html> | ||
<!doctype html> | ||
<html> | ||
<head> | ||
<meta charset="utf-8" /> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import { UUID } from '@graasp/sdk'; | ||
|
||
import Agent from '@/types/Agent'; | ||
|
||
type AssistantSettings = Omit<Agent, 'type'>; | ||
|
||
export type AssistantsSettingsType = { | ||
assistantList: AssistantSettings[]; | ||
}; | ||
|
||
export type ChatSettingsType = { | ||
description: string; | ||
participantInstructions: string; | ||
participantEndText: string; | ||
}; | ||
|
||
export type ExchangeSettings = { | ||
id: UUID; | ||
assistant: AssistantSettings; | ||
description: string; | ||
chatbotInstructions: string; | ||
participantCue: string; | ||
nbFollowUpQuestions: number; | ||
participantInstructionsOnComplete?: string; | ||
hardLimit: boolean; | ||
}; | ||
|
||
export type ExchangesSettingsType = { exchangeList: ExchangeSettings[] }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
import { Member } from '@graasp/sdk'; | ||
|
||
import { t } from 'i18next'; | ||
import { v4 as uuidv4 } from 'uuid'; | ||
|
||
import { defaultSettingsValues } from '@/modules/context/SettingsContext'; | ||
import Agent from '@/types/Agent'; | ||
import AgentType from '@/types/AgentType'; | ||
import Exchange from '@/types/Exchange'; | ||
import Interaction from '@/types/Interaction'; | ||
|
||
export const MIN_FOLLOW_UP_QUESTIONS: number = 0; | ||
export const MAX_FOLLOW_UP_QUESTIONS: number = 400; | ||
export const MAX_TEXT_INPUT_CHARS: number = 5000; | ||
|
||
// Define a default user as an agent | ||
export const defaultUser: Agent = { | ||
id: uuidv4(), | ||
name: 'Default User', | ||
description: 'Default user description', | ||
type: AgentType.User, | ||
}; | ||
|
||
// Define a default assistant as an agent | ||
export const defaultAssistant: Agent = { | ||
id: uuidv4(), | ||
name: 'Default Assistant', | ||
description: 'Default assistant description', | ||
type: AgentType.Assistant, | ||
}; | ||
|
||
// Define a default interaction object using default settings | ||
export const defaultInteraction: Interaction = { | ||
...defaultSettingsValues.chat, | ||
id: uuidv4(), | ||
currentExchange: 0, | ||
started: false, | ||
completed: false, | ||
participant: defaultUser, | ||
exchanges: { exchangeList: [] }, | ||
createdAt: new Date(), | ||
updatedAt: new Date(), | ||
}; | ||
|
||
// Define a default exchange object using default settings | ||
export const defaultExchange: Exchange = { | ||
...defaultSettingsValues.exchanges.exchangeList[0], | ||
messages: [], | ||
assistant: defaultAssistant, | ||
started: false, | ||
completed: false, | ||
dismissed: false, | ||
createdAt: new Date(), | ||
updatedAt: new Date(), | ||
}; | ||
|
||
export const placeholderMember: Member = { | ||
id: '', | ||
name: t('CONVERSATIONS.PLACEHOLDER'), | ||
email: '', | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,71 @@ | ||
{ | ||
"translations": { | ||
"Welcome to the Graasp App Starter Kit": "Bienvenue dans le kit de démarrage de l'application Graasp" | ||
"ERROR_BOUNDARY": { | ||
"FALLBACK": { | ||
"MESSAGE_TITLE": "Désolé, quelque chose n'a pas fonctionné avec cette application", | ||
"MESSAGE_FEEDBACK": "Notre équipe a été informée. Si vous souhaitez nous aider, veuillez nous expliquer ce qui s'est passé ci-dessous", | ||
"ERROR_DETAILS": "Détails de l'erreur", | ||
"NAME_LABEL": "Name", | ||
"NAME_HELPER": "Fournissez votre nom (facultatif)", | ||
"EMAIL_LABEL": "Email", | ||
"EMAIL_HELPER": "Fournissez votre courriel (facultatif)", | ||
"COMMENT_LABEL": "Commentaire", | ||
"COMMENT_HELPER": "Racontez-nous ce qui s'est passé (facultatif)", | ||
"THANKS_FOR_FEEDBACK": "Thank you for your feedback !", | ||
"SEND": "Envoyez votre retour d'information" | ||
} | ||
}, | ||
"SETTINGS": { | ||
"TITLE": "Paramètres de l'application", | ||
"SAVE_BTN": "Enregistrer", | ||
"UP": "Déplacer vers le haut", | ||
"DOWN": "Déplacer vers le bas", | ||
"ASSISTANTS": { | ||
"TITLE": "Paramètres de l'Assistant", | ||
"ID": "Assistant ID", | ||
"NAME": "Nom de l'Assistant", | ||
"DESCRIPTION": "Description de l'Assistant", | ||
"IMAGE": "Image de l'Assistant", | ||
"URL": "Veuillez saisir un lien fonctionnel vers l'image souhaitée.", | ||
"ADD": "Créer un Nouvel Assistant", | ||
"CREATE": "Veuillez créer au moins un assistant." | ||
}, | ||
"CHAT": { | ||
"TITLE": " Paramètres du Chat", | ||
"DESCRIPTION": "Description du Chat", | ||
"INSTRUCTIONS": "Instructions pour le Participant", | ||
"END": "Texte de Fin d'Écran", | ||
"USER": "Participant" | ||
}, | ||
"EXCHANGES": { | ||
"TITLE": "Échanges Paramètres", | ||
"DESCRIPTION": "Description des Échanges", | ||
"INSTRUCTIONS": "Instructions du Chatbot", | ||
"CUE": "Initial Cue", | ||
"ASSISTANT": "Assistant", | ||
"CREATE_ASSISTANT": "Veuillez créer au moins un assistant.", | ||
"FOLLOW_UP_QUESTIONS": "Nombre de Questions de Suivi", | ||
"ON_COMPLETE": "Instruction sur l'achèvement de l'échange", | ||
"ON_COMPLETE_HELPER": "Ce texte s'affichera une fois que le nombre donné de questions de suivi aura été répondu. Laisser en blanc si aucun message n'est affiché.", | ||
"DISABLE_HARD_LIMIT": "Rejet Automatique", | ||
"HARD_LIMIT_INFO": "Si cette case est cochée, l'échange suivant commencera automatiquement une fois que le nombre de questions de suivi sera atteint", | ||
"CREATE": "Veuillez créer au moins un échange." | ||
} | ||
}, | ||
"CONVERSATIONS": { | ||
"TITLE": "Voir les Conversations", | ||
"MEMBER": "Veuillez sélectionner un membre", | ||
"PLACEHOLDER": "Veuillez sélectionner un membre", | ||
"NONE": "Aucune conversation jusqu'à présent.", | ||
"COMPLETE": "Terminé", | ||
"INCOMPLETE": "Pas terminé", | ||
"RESET": "Supprimer et réinitialiser la conversation" | ||
}, | ||
"START": "Démarrer", | ||
"MESSAGE_BOX": { | ||
"INSERT_HERE": "Votre réponse ici...", | ||
"SEND": "Envoyer", | ||
"DONE": "Fini" | ||
} | ||
} | ||
} |
Oops, something went wrong.