Danh mục: Dịch vụ bảo hộ quyền sở hữu trí tuệ

{ text: "Xin chào! Tôi là Trợ lý AI của Hãng luật DHP. Tôi có thể giúp gì cho bạn?", role: "ai" } ]; chatElement.request = { url: `https://googleapis.com{AQ.Ab8RN6IZi7URRGzv5HkNDImZRzmReOIJMcwqzn8DcXylH78OHA}`, method: 'POST', headers: { 'Content-Type': 'application/json' }, handler: (body, signals) => { const requestBody = { contents: [{ parts: [{ text: body.text }] }] }; fetch(chatElement.request.url, { method: 'POST', headers: chatElement.request.headers, body: JSON.stringify(requestBody) }) .then(res => res.json()) .then(data => { if (data.candidates && data.candidates[0].content.parts[0].text) { signals.onResponse({ text: data.candidates[0].content.parts[0].text }); } else { signals.onResponse({ text: 'Tôi chưa tìm thấy câu trả lời phù hợp.' }); } }) .catch(err => { signals.onResponse({ error: 'Không thể kết nối máy chủ.' }); }); } }; });