Files
hack/tools/scripts/llm-key-hunter/results/_cache/content/antonyayansi_taller-proyectos-1.json
T
OpenCode 68a9071cf1 feat: reconcile local master with origin (exa/hot-platform hunters, leaks ledger, latest results)
Local branch had diverged from origin/master (sibling commits on the same base). Rewrote local history linearly on top of origin/master, folding in all local content: exa/hot-platform discovery hunters, leaks ledger, nightly sweep orchestrator, updated .gitignore and skill docs, plus the latest hunt output and vault state. Remote-only files (vault keys, channel scripts) were restored rather than dropped, so the resulting tree is a full union of both sides.
2026-08-07 12:53:47 +08:00

1 line
4.0 KiB
JSON

{"repo": "antonyayansi/taller-proyectos-1", "files": {"quilla_frontend/src/services/deepseek.js": {"9325b3502fbb0060b5f44871bf8007669e1aa924": {"t": 1786068265.3294685, "n": 3747, "h": "d08f3469b23b3582", "c": "/**\n * Servicio para interactuar con DeepSeek API\n * Proporciona funcionalidades de chat y asistente IA\n */\n\nconst DEEPSEEK_API_URL = 'https://api.deepseek.com/chat/completions';\nconst DEEPSEEK_API_KEY = import.meta.env.VITE_DEEPSEEK_API_KEY;\n\n/**\n * Envía un mensaje al asistente de DeepSeek\n * @param {string} message - Mensaje del usuario\n * @param {object} context - Contexto adicional (información del sitio, ubicación, etc.)\n * @returns {Promise<string>} - Respuesta del asistente\n */\nexport async function askDeepSeek(message, context = {}) {\n try {\n const systemPrompt = buildSystemPrompt(context);\n \n const response = await fetch(DEEPSEEK_API_URL, {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json',\n 'Authorization': `Bearer ${DEEPSEEK_API_KEY}`,\n },\n body: JSON.stringify({\n model: 'deepseek-chat',\n messages: [\n {\n role: 'system',\n content: systemPrompt\n },\n {\n role: 'user',\n content: message\n }\n ],\n temperature: 0.7,\n max_tokens: 500,\n stream: false\n })\n });\n\n if (!response.ok) {\n const errorData = await response.json();\n throw new Error(`DeepSeek API Error: ${errorData.error?.message || response.statusText}`);\n }\n\n const data = await response.json();\n return data.choices[0].message.content;\n } catch (error) {\n console.error('Error en askDeepSeek:', error);\n throw error;\n }\n}\n\n/**\n * Construye el prompt del sistema con el contexto del sitio\n * @param {object} context - Información del sitio activo\n * @returns {string} - Prompt del sistema\n */\nfunction buildSystemPrompt(context) {\n const { sitio, ubicacion } = context;\n \n let prompt = `Eres un guía turístico virtual experto y amigable de Cusco, Perú. Tu objetivo es ayudar a los turistas proporcionando información clara, concisa y útil sobre los lugares turísticos.\n\nINSTRUCCIONES:\n- Responde siempre en español de manera clara y amigable\n- Sé breve y conciso (máximo 3-4 oraciones)\n- Usa un tono conversacional y entusiasta\n- Si no sabes algo, sé honesto pero ofrece información relacionada\n- Enfócate en datos interesantes, historia, consejos prácticos y recomendaciones`;\n\n if (sitio) {\n prompt += `\\n\\nCONTEXTO DEL LUGAR ACTUAL:\n- Nombre: ${sitio.nombre}\n- Descripción: ${sitio.descripcion}\n- Categoría: ${sitio.categorias?.nombre || 'N/A'}\n- Distancia del usuario: ${sitio.distancia} km\n- Horarios: ${sitio.horarios || 'No especificado'}\n- Precio: ${sitio.precio || 'No especificado'}`;\n\n if (sitio.rutas && sitio.rutas.length > 0) {\n prompt += `\\n- Rutas disponibles: ${sitio.rutas.map(r => r.nombre).join(', ')}`;\n }\n }\n\n if (ubicacion) {\n prompt += `\\n\\nUBICACIÓN DEL USUARIO:\n- Latitud: ${ubicacion.lat}\n- Longitud: ${ubicacion.lng}`;\n }\n\n prompt += `\\n\\nRecuerda: El usuario puede estar preguntando por voz, así que tu respuesta se convertirá en audio. Hazla natural y fácil de escuchar.`;\n\n return prompt;\n}\n\n/**\n * Genera un mensaje de error amigable\n * @param {Error} error - Error original\n * @returns {string} - Mensaje de error para el usuario\n */\nexport function getErrorMessage(error) {\n if (error.message.includes('API')) {\n return 'Lo siento, no puedo conectar con el servicio en este momento. Por favor intenta de nuevo más tarde.';\n }\n return 'Lo siento, ocurrió un error. Por favor intenta de nuevo.';\n}\n"}}}}