{"repo": "adivader19/instalily-ai-case-study", "files": {"agents/WarrantyAgent.js": {"cdf93a9f0e359b42a21f65742f68001e45d130dd": {"t": 1785746018.7486012, "n": 3079, "h": "fc728a30047bc843", "c": "const axios = require('axios');\n\nclass WarrantyAgent {\n constructor(apiKey) {\n this.apiKey = apiKey;\n this.agentName = 'Warranty Specialist';\n this.specialty = 'Warranty claims, coverage verification, and documentation assistance';\n }\n\n async handleWarrantyQuery(userQuery, conversationHistory = []) {\n if (!this.apiKey) {\n throw new Error('Deepseek API key not configured for Warranty Agent.');\n }\n\n const systemPrompt = `You are a knowledgeable Warranty Specialist for Instalily, an appliance parts and service company.\n\nYour expertise includes:\n- Warranty coverage verification and explanations\n- Warranty claim filing procedures and requirements\n- Required documentation for warranty claims\n- Warranty terms and conditions interpretation\n- Extended warranty options and benefits\n- Out-of-warranty repair cost estimates\n- Service appointment scheduling for warranty repairs\n- Warranty transfer procedures for used appliances\n- Prorated warranty calculations\n- Manufacturer warranty vs. store warranty differences\n\nGuidelines:\n- Help customers understand their warranty coverage\n- Guide them through the claim filing process step-by-step\n- Explain what documentation they need to provide\n- Clarify warranty terms in simple language\n- Assist with warranty registration when needed\n- Provide realistic timelines for warranty processing\n- Explain what is and isn't covered under warranty\n- Help customers understand their rights and options\n\nFor specific warranty lookups, remind customers you'll need:\n- Purchase date and receipt/invoice\n- Model and serial numbers\n- Description of the issue or defect\n- Photos of the problem (if applicable)\n\nAlways maintain a helpful, empathetic tone when dealing with warranty issues and be clear about next steps.`;\n\n const conversationContext = conversationHistory.length > 0 \n ? `\\n\\nPrevious conversation context:\\n${conversationHistory.slice(-3).join('\\n')}`\n : '';\n\n try {\n const response = await axios.post(\n 'https://api.deepseek.com/v1/chat/completions',\n {\n model: 'deepseek-chat',\n messages: [\n { role: 'system', content: systemPrompt },\n { role: 'user', content: `${userQuery}${conversationContext}` }\n ],\n max_tokens: 900,\n temperature: 0.6,\n stream: false\n },\n {\n headers: {\n 'Authorization': `Bearer ${this.apiKey}`,\n 'Content-Type': 'application/json'\n }\n }\n );\n\n return response.data.choices[0].message.content.trim();\n } catch (error) {\n console.error('Warranty Agent API Error:', error.response?.data || error.message);\n throw new Error('Failed to get warranty assistance. Please try again.');\n }\n }\n}\n\nmodule.exports = WarrantyAgent;\n"}, "f4f45b38451b92c3e4d7ec6a7a4834d67068d3fd": {"t": 1785758839.5163126, "n": 3079, "h": "fc728a30047bc843", "c": "const axios = require('axios');\n\nclass WarrantyAgent {\n constructor(apiKey) {\n this.apiKey = apiKey;\n this.agentName = 'Warranty Specialist';\n this.specialty = 'Warranty claims, coverage verification, and documentation assistance';\n }\n\n async handleWarrantyQuery(userQuery, conversationHistory = []) {\n if (!this.apiKey) {\n throw new Error('Deepseek API key not configured for Warranty Agent.');\n }\n\n const systemPrompt = `You are a knowledgeable Warranty Specialist for Instalily, an appliance parts and service company.\n\nYour expertise includes:\n- Warranty coverage verification and explanations\n- Warranty claim filing procedures and requirements\n- Required documentation for warranty claims\n- Warranty terms and conditions interpretation\n- Extended warranty options and benefits\n- Out-of-warranty repair cost estimates\n- Service appointment scheduling for warranty repairs\n- Warranty transfer procedures for used appliances\n- Prorated warranty calculations\n- Manufacturer warranty vs. store warranty differences\n\nGuidelines:\n- Help customers understand their warranty coverage\n- Guide them through the claim filing process step-by-step\n- Explain what documentation they need to provide\n- Clarify warranty terms in simple language\n- Assist with warranty registration when needed\n- Provide realistic timelines for warranty processing\n- Explain what is and isn't covered under warranty\n- Help customers understand their rights and options\n\nFor specific warranty lookups, remind customers you'll need:\n- Purchase date and receipt/invoice\n- Model and serial numbers\n- Description of the issue or defect\n- Photos of the problem (if applicable)\n\nAlways maintain a helpful, empathetic tone when dealing with warranty issues and be clear about next steps.`;\n\n const conversationContext = conversationHistory.length > 0 \n ? `\\n\\nPrevious conversation context:\\n${conversationHistory.slice(-3).join('\\n')}`\n : '';\n\n try {\n const response = await axios.post(\n 'https://api.deepseek.com/v1/chat/completions',\n {\n model: 'deepseek-chat',\n messages: [\n { role: 'system', content: systemPrompt },\n { role: 'user', content: `${userQuery}${conversationContext}` }\n ],\n max_tokens: 900,\n temperature: 0.6,\n stream: false\n },\n {\n headers: {\n 'Authorization': `Bearer ${this.apiKey}`,\n 'Content-Type': 'application/json'\n }\n }\n );\n\n return response.data.choices[0].message.content.trim();\n } catch (error) {\n console.error('Warranty Agent API Error:', error.response?.data || error.message);\n throw new Error('Failed to get warranty assistance. Please try again.');\n }\n }\n}\n\nmodule.exports = WarrantyAgent;\n"}}}}