diff --git a/components/ChatbotSheet.vue b/components/ChatbotSheet.vue
index 94ea6a1..344ec58 100644
--- a/components/ChatbotSheet.vue
+++ b/components/ChatbotSheet.vue
@@ -61,7 +61,9 @@
- {{ props.title ?? 'Chatbot' }}
+
+ {{ props.title ?? (activeEndpoint === '/api/chatbot-reseaux' ? 'Réseaux AEP' : 'Chatbot') }}
+
@@ -168,6 +170,14 @@
import { useMarkdown } from '~/composables/useMarkdown'
const { render: renderMd } = useMarkdown()
+// Détection double-sécurité : prop endpoint > route-based fallback
+const route = useRoute()
+const activeEndpoint = computed(() => {
+ if (props.endpoint) return props.endpoint
+ if (route.path.startsWith('/agences')) return '/api/chatbot-reseaux'
+ return '/api/chatbot'
+})
+
interface FicheReco {
id: number | string
nom: string
@@ -232,7 +242,7 @@ async function sendMessage() {
const res = await $fetch<{
reponse_texte: string
fiches_recommandees: { id: number | string; nom: string; explication: string }[]
- }>(props.endpoint ?? '/api/chatbot', {
+ }>(activeEndpoint.value, {
method: 'POST',
body: { question },
})