fix(chatbot): import explicite useMarkdown + titre/onboarding par carte
- ChatbotSheet: import explicite useMarkdown (plus d'auto-import incertain) - Props: title, onboarding, endpoint - agences.vue: titre 'Réseaux AEP' + message d'accueil distinct + endpoint correct - Header chatbot affiche le nom de la carte active Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -61,7 +61,7 @@
|
|||||||
<path d="M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z"/>
|
<path d="M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z"/>
|
||||||
</svg>
|
</svg>
|
||||||
</div>
|
</div>
|
||||||
<span class="font-bold text-sm" style="color: var(--nav-text);">Chatbot</span>
|
<span class="font-bold text-sm" style="color: var(--nav-text);">{{ props.title ?? 'Chatbot' }}</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -69,6 +69,8 @@
|
|||||||
<div ref="messagesContainer" class="flex-1 overflow-y-auto px-4 py-4 flex flex-col gap-3">
|
<div ref="messagesContainer" class="flex-1 overflow-y-auto px-4 py-4 flex flex-col gap-3">
|
||||||
<!-- Message onboarding (avant la première question) -->
|
<!-- Message onboarding (avant la première question) -->
|
||||||
<div v-if="messages.length === 0" class="onboarding-bubble">
|
<div v-if="messages.length === 0" class="onboarding-bubble">
|
||||||
|
<p v-if="props.onboarding" v-html="renderMd(props.onboarding)" />
|
||||||
|
<template v-else>
|
||||||
<p>Ce chatbot fonctionne sur un serveur européen souverain
|
<p>Ce chatbot fonctionne sur un serveur européen souverain
|
||||||
(Mistral FR, zéro rétention), conçu sobre en énergie.</p>
|
(Mistral FR, zéro rétention), conçu sobre en énergie.</p>
|
||||||
<p>Pour m'aider à te répondre efficacement,
|
<p>Pour m'aider à te répondre efficacement,
|
||||||
@@ -81,6 +83,7 @@ formule ta requête ainsi :</p>
|
|||||||
<p class="example">Exemple : "Je suis salarié d'agence, litige avec mon
|
<p class="example">Exemple : "Je suis salarié d'agence, litige avec mon
|
||||||
employeur, besoin conseil juridique droit du travail,
|
employeur, besoin conseil juridique droit du travail,
|
||||||
Île-de-France."</p>
|
Île-de-France."</p>
|
||||||
|
</template>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- Messages -->
|
<!-- Messages -->
|
||||||
@@ -164,6 +167,7 @@ employeur, besoin conseil juridique droit du travail,
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
|
import { useMarkdown } from '~/composables/useMarkdown'
|
||||||
const { render: renderMd } = useMarkdown()
|
const { render: renderMd } = useMarkdown()
|
||||||
|
|
||||||
interface FicheReco {
|
interface FicheReco {
|
||||||
@@ -180,7 +184,9 @@ interface ChatMessage {
|
|||||||
|
|
||||||
const props = defineProps<{
|
const props = defineProps<{
|
||||||
modelValue: boolean
|
modelValue: boolean
|
||||||
endpoint?: string // défaut: /api/chatbot (Carte 1 NocoDB)
|
endpoint?: string // défaut: /api/chatbot (Carte 1 NocoDB)
|
||||||
|
title?: string // label dans le header
|
||||||
|
onboarding?: string // message d'accueil personnalisé (markdown ok)
|
||||||
}>()
|
}>()
|
||||||
|
|
||||||
const emit = defineEmits<{
|
const emit = defineEmits<{
|
||||||
|
|||||||
@@ -377,6 +377,8 @@
|
|||||||
<ChatbotSheet
|
<ChatbotSheet
|
||||||
:modelValue="chatbotOpen"
|
:modelValue="chatbotOpen"
|
||||||
endpoint="/api/chatbot-reseaux"
|
endpoint="/api/chatbot-reseaux"
|
||||||
|
title="Réseaux AEP"
|
||||||
|
onboarding="Je connais les **120 réseaux, collectifs et agences** cartographiés dans AEP — ceux qui portent une vision écologique et politique de l'architecture.\n\nDécris ta situation : tu cherches un collectif, une agence inspirante, un partenaire sur un projet ?"
|
||||||
@update:modelValue="chatbotOpen = $event"
|
@update:modelValue="chatbotOpen = $event"
|
||||||
@highlightOrgs="() => {}"
|
@highlightOrgs="() => {}"
|
||||||
/>
|
/>
|
||||||
|
|||||||
Reference in New Issue
Block a user