diff --git a/internal/chat/handler.go b/internal/chat/handler.go
index 1dd296b..37bb57c 100644
--- a/internal/chat/handler.go
+++ b/internal/chat/handler.go
@@ -144,8 +144,11 @@ func (h *Handler) HandleChat(w http.ResponseWriter, r *http.Request) {
if err != nil {
log.Printf("Chat agent error: %v", err)
w.Header().Set("Content-Type", "text/html; charset=utf-8")
- w.WriteHeader(http.StatusInternalServerError)
- _, _ = fmt.Fprint(w, `
Something went wrong. Please try again.
`)
+ errMsg := "Something went wrong. Please try again in a moment."
+ if strings.Contains(err.Error(), "429") || strings.Contains(err.Error(), "RESOURCE_EXHAUSTED") {
+ errMsg = "The AI service is temporarily busy. Please try again in a few seconds."
+ }
+ _, _ = fmt.Fprintf(w, `%s
`, errMsg)
return
}
if event.IsFinalResponse() {
diff --git a/templates/partials/modals/chat-help-modal.html b/templates/partials/modals/chat-help-modal.html
index 52c2ea1..25b8805 100644
--- a/templates/partials/modals/chat-help-modal.html
+++ b/templates/partials/modals/chat-help-modal.html
@@ -31,10 +31,10 @@
{{if eq .Lang "es"}}Experiencia{{else}}Experience{{end}}
- {{if eq .Lang "es"}}¿Cuántos años de experiencia tiene?{{else}}How many years of experience?{{end}}
- {{if eq .Lang "es"}}¿En qué empresas ha trabajado?{{else}}What companies has he worked at?{{end}}
- {{if eq .Lang "es"}}Cuéntame sobre Olympic Broadcasting{{else}}Tell me about Olympic Broadcasting{{end}}
- {{if eq .Lang "es"}}¿Qué hacía en SAP?{{else}}What did he do at SAP?{{end}}
+ {{if eq .Lang "es"}}¿Cuántos años de experiencia tiene?{{else}}How many years of experience?{{end}}
+ {{if eq .Lang "es"}}¿En qué empresas ha trabajado?{{else}}What companies has he worked at?{{end}}
+ {{if eq .Lang "es"}}Cuéntame sobre Olympic Broadcasting{{else}}Tell me about Olympic Broadcasting{{end}}
+ {{if eq .Lang "es"}}¿Qué hacía en SAP?{{else}}What did he do at SAP?{{end}}
@@ -45,11 +45,11 @@
{{if eq .Lang "es"}}Tecnologías{{else}}Technologies{{end}}
- {{if eq .Lang "es"}}¿Qué lenguajes conoce?{{else}}What languages does he know?{{end}}
- {{if eq .Lang "es"}}¿Ha trabajado con React?{{else}}Has he worked with React?{{end}}
- {{if eq .Lang "es"}}¿Experiencia con Go?{{else}}Go experience?{{end}}
- {{if eq .Lang "es"}}¿Conoce Node.js?{{else}}Does he know Node.js?{{end}}
- {{if eq .Lang "es"}}¿Experiencia con Docker?{{else}}Docker experience?{{end}}
+ {{if eq .Lang "es"}}¿Qué lenguajes conoce?{{else}}What languages does he know?{{end}}
+ {{if eq .Lang "es"}}¿Ha trabajado con React?{{else}}Has he worked with React?{{end}}
+ {{if eq .Lang "es"}}¿Experiencia con Go?{{else}}Go experience?{{end}}
+ {{if eq .Lang "es"}}¿Conoce Node.js?{{else}}Does he know Node.js?{{end}}
+ {{if eq .Lang "es"}}¿Experiencia con Docker?{{else}}Docker experience?{{end}}
@@ -60,9 +60,9 @@
{{if eq .Lang "es"}}Proyectos{{else}}Projects{{end}}
- {{if eq .Lang "es"}}¿Qué proyectos ha creado?{{else}}What projects has he built?{{end}}
- {{if eq .Lang "es"}}Sobre Immich Photo Manager{{else}}About Immich Photo Manager{{end}}
- {{if eq .Lang "es"}}¿Proyectos open-source?{{else}}Open-source projects?{{end}}
+ {{if eq .Lang "es"}}¿Qué proyectos ha creado?{{else}}What projects has he built?{{end}}
+ {{if eq .Lang "es"}}Sobre Immich Photo Manager{{else}}About Immich Photo Manager{{end}}
+ {{if eq .Lang "es"}}¿Proyectos open-source?{{else}}Open-source projects?{{end}}
@@ -73,9 +73,9 @@
{{if eq .Lang "es"}}Formación{{else}}Education{{end}}
- {{if eq .Lang "es"}}¿Certificaciones?{{else}}Certifications?{{end}}
- {{if eq .Lang "es"}}¿Dónde estudió?{{else}}Where did he study?{{end}}
- {{if eq .Lang "es"}}¿Cursos completados?{{else}}Courses completed?{{end}}
+ {{if eq .Lang "es"}}¿Certificaciones?{{else}}Certifications?{{end}}
+ {{if eq .Lang "es"}}¿Dónde estudió?{{else}}Where did he study?{{end}}
+ {{if eq .Lang "es"}}¿Cursos completados?{{else}}Courses completed?{{end}}
@@ -86,9 +86,9 @@
{{if eq .Lang "es"}}Habilidades{{else}}Skills{{end}}
- {{if eq .Lang "es"}}¿Habilidades técnicas principales?{{else}}Main technical skills?{{end}}
- {{if eq .Lang "es"}}¿Experiencia con CI/CD?{{else}}CI/CD experience?{{end}}
- {{if eq .Lang "es"}}¿Qué idiomas habla?{{else}}Languages spoken?{{end}}
+ {{if eq .Lang "es"}}¿Habilidades técnicas principales?{{else}}Main technical skills?{{end}}
+ {{if eq .Lang "es"}}¿Experiencia con CI/CD?{{else}}CI/CD experience?{{end}}
+ {{if eq .Lang "es"}}¿Qué idiomas habla?{{else}}Languages spoken?{{end}}
diff --git a/templates/partials/widgets/chat-widget.html b/templates/partials/widgets/chat-widget.html
index 761f0c0..41d3984 100644
--- a/templates/partials/widgets/chat-widget.html
+++ b/templates/partials/widgets/chat-widget.html
@@ -6,14 +6,7 @@
class="chat-toggle-btn no-print has-tooltip tooltip-left"
aria-label="{{if eq .Lang "es"}}Asistente del CV{{else}}CV Assistant{{end}}"
data-tooltip="{{if eq .Lang "es"}}Asistente del CV{{else}}CV Assistant{{end}}"
- _="on click toggle .chat-open on #chat-panel
- then if #chat-panel matches .chat-open
- then add .mascot-active to me
- then set #chat-input.focus to true
- then call #chat-input.focus()
- else
- remove .mascot-active from me
- end">
+ onclick="toggleChatPanel()">
@@ -46,27 +39,17 @@
{{if eq .Lang "es"}}
- ¿Proyectos en Go?
- ¿Años de experiencia?
- ¿Empresas?
- ¿Conoce React?
- ¿Certificaciones?
+ ¿Proyectos en Go?
+ ¿Años de experiencia?
+ ¿Empresas?
+ ¿Conoce React?
+ ¿Certificaciones?
{{else}}
- Go projects?
- Years of experience?
- Companies?
- Knows React?
- Certifications?
+ Go projects?
+ Years of experience?
+ Companies?
+ Knows React?
+ Certifications?
{{end}}
@@ -74,8 +57,7 @@
hx-post="/api/chat"
hx-target="#chat-messages"
hx-swap="beforeend scroll:#chat-messages:bottom"
- hx-indicator="#chat-typing"
- _="on htmx:afterRequest set #chat-input.value to ''">
+ hx-indicator="#chat-typing">
+
+
+
{{end}}
{{end}}