Spaces:
Running
Running
| from __future__ import annotations | |
| PACKS: dict[str, dict] = { | |
| "es": { | |
| "whisper": "es", | |
| "voice": "es_MX-claude-high.onnx", | |
| "search_region": "Perú", | |
| "search_filler": {"noticia", "noticias"}, | |
| "persona": ( | |
| "/no_think\n" | |
| "Eres un companero amable y paciente para una persona mayor. " | |
| "Hablas en espanol sencillo y calido. Responde en 1 a 3 frases " | |
| "cortas, sin listas ni simbolos, como en una conversacion hablada. " | |
| "Te interesas por su dia, recuerdas lo que te cuenta y le haces " | |
| "compania. Cuidas su privacidad: no expones sus datos personales. " | |
| "Puedes consultar y contarle informacion publica y actual cuando lo " | |
| "necesite." | |
| ), | |
| "profile_header": "Esto es lo que sabes sobre la persona con la que hablas:", | |
| "recall_header": "Recuerdos relevantes de conversaciones anteriores:", | |
| "profile_example": ( | |
| 'nombre: Pedro\n' | |
| 'edad: 78\n' | |
| 'familia:\n' | |
| ' - "Hija: Ana, vive cerca"\n' | |
| ' - "Nietos: Luis y Sofía"\n' | |
| 'intereses:\n' | |
| ' - jardinería\n' | |
| ' - música criolla\n' | |
| 'rutina:\n' | |
| ' - "Camina por las mañanas"\n' | |
| ' - "Pastillas para la presión a las 8am y 8pm"\n' | |
| 'salud:\n' | |
| ' - "Presión alta, controlada"\n' | |
| ' - "Usa lentes para leer"\n' | |
| 'tono: "Trátalo con cariño; puedes decirle Don Pedro"\n' | |
| ), | |
| "web_header": ( | |
| "Estos son los resultados de una busqueda en internet que YA hiciste " | |
| "por el usuario, mas recientes que tu memoria. Buscar informacion " | |
| "publica es parte de tu trabajo y no afecta su privacidad, asi que " | |
| "NUNCA digas que no puedes buscar ni que va contra su privacidad. " | |
| "Responde apoyandote en estos resultados: di quienes participan y " | |
| "que se sabe hasta ahora, aunque no haya un resultado final. Menciona " | |
| "solo los nombres y cifras que aparezcan aqui; no inventes datos ni " | |
| "personas que no esten. Si falta un dato exacto, dilo:" | |
| ), | |
| "today_header": "Fecha de hoy", | |
| "query_instruction": ( | |
| "/no_think\nLee la conversacion y escribe una consulta de busqueda " | |
| "web para responder SOLO el ultimo mensaje del usuario. Usa los " | |
| "mensajes anteriores unicamente para entender a que se refiere " | |
| "(quien es 'el', de que tema habla). Si el ultimo mensaje cambia de " | |
| "tema, ignora lo anterior. Responde SOLO con palabras clave " | |
| "(lugares, nombres, cosas), sin relleno, sin comillas, sin " | |
| "explicacion.\n\n" | |
| ), | |
| "ui": { | |
| "title": "👋 Amigo", | |
| "subtitle": "Aquí estoy para conversar contigo", | |
| "profile_label": "Mi perfil (edítalo)", | |
| "profile_help": "Cuéntame quién eres para acompañarte mejor.", | |
| "mic": "🎤 Háblame aquí", | |
| "reply": "🔊 Amigo te responde", | |
| "chat_placeholder": "Aquí verás nuestra conversación 💬", | |
| "not_heard": "No te escuché bien. ¿Repites?", | |
| "states": { | |
| "idle": ["🙂", "Aprieta el botón y háblame"], | |
| "listening": ["👂", "Te escucho…"], | |
| "thinking": ["💭", "Déjame pensar…"], | |
| "talking": ["💬", "Te respondo…"], | |
| }, | |
| }, | |
| }, | |
| "en": { | |
| "whisper": "en", | |
| "voice": "en_US-amy-medium.onnx", # download separately if you use "en" | |
| "search_region": "", | |
| "search_filler": {"news"}, | |
| "persona": ( | |
| "/no_think\n" | |
| "You are a warm, patient companion for an older adult. You speak in " | |
| "simple, kind language. Reply in 1 to 3 short sentences, without " | |
| "lists or symbols, like a spoken conversation. You take interest in " | |
| "their day, remember what they tell you, and keep them company. You " | |
| "protect their privacy and never expose their personal details. " | |
| "You can look up and share public, current information whenever they " | |
| "need it." | |
| ), | |
| "profile_header": "Here is what you know about the person you talk to:", | |
| "recall_header": "Relevant memories from past conversations:", | |
| "profile_example": ( | |
| 'name: Margaret\n' | |
| 'age: 80\n' | |
| 'family:\n' | |
| ' - "Son: David, visits on weekends"\n' | |
| ' - "Grandchildren: Emma and Jack"\n' | |
| 'interests:\n' | |
| ' - gardening\n' | |
| ' - crosswords\n' | |
| 'routine:\n' | |
| ' - "Morning walk"\n' | |
| ' - "Blood pressure pills at 8am and 8pm"\n' | |
| 'health:\n' | |
| ' - "Wears glasses for reading"\n' | |
| 'tone: "Warm and patient; you can call her Maggie"\n' | |
| ), | |
| "web_header": ( | |
| "These are results from an internet search you ALREADY ran for the " | |
| "user, more recent than your memory. Looking up public information " | |
| "is part of your job and does not affect their privacy, so NEVER say " | |
| "you cannot search or that it breaks their privacy. Answer using " | |
| "these results: say who is involved and what is known so far, even " | |
| "if there is no final answer. Mention only the names and figures " | |
| "that appear here; do not invent facts or people that are not " | |
| "present. If an exact figure is missing, say so:" | |
| ), | |
| "today_header": "Today's date", | |
| "query_instruction": ( | |
| "/no_think\nRead the conversation and write a web search query to " | |
| "answer ONLY the user's last message. Use the earlier messages just " | |
| "to understand what it refers to (who 'he' is, what topic). If the " | |
| "last message changes the subject, ignore the earlier ones. Reply " | |
| "ONLY with keywords (places, names, things), no filler, no quotes, " | |
| "no explanation.\n\n" | |
| ), | |
| "ui": { | |
| "title": "👋 Amigo", | |
| "subtitle": "I'm here to chat with you", | |
| "profile_label": "My profile (edit it)", | |
| "profile_help": "Tell me who you are so I can keep you better company.", | |
| "mic": "🎤 Talk to me here", | |
| "reply": "🔊 Amigo replies", | |
| "chat_placeholder": "Our conversation will appear here 💬", | |
| "not_heard": "I didn't catch that. Can you say it again?", | |
| "states": { | |
| "idle": ["🙂", "Press the button and talk to me"], | |
| "listening": ["👂", "I'm listening…"], | |
| "thinking": ["💭", "Let me think…"], | |
| "talking": ["💬", "Here's my reply…"], | |
| }, | |
| }, | |
| }, | |
| } | |
| def get(lang: str) -> dict: | |
| """Return the pack for `lang`, falling back to Spanish.""" | |
| return PACKS.get(lang, PACKS["es"]) | |