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 6 |
+
- chrf
|
| 7 |
+
tags:
|
| 8 |
+
- finance
|
| 9 |
+
---
|
| 10 |
+
<!DOCTYPE html>
|
| 11 |
+
<html lang="en">
|
| 12 |
+
|
| 13 |
+
<head>
|
| 14 |
+
<meta charset="UTF-8">
|
| 15 |
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
| 16 |
+
<title>Gemini</title>
|
| 17 |
+
<script src="ReporteDatoslaboralesNomina.json"></script>
|
| 18 |
+
<script>
|
| 19 |
+
// Aqu铆 procesar谩s los datos del JSON
|
| 20 |
+
fetch('ReporteDatoslaboralesNomina.json')
|
| 21 |
+
.then(response => response.json())
|
| 22 |
+
.then(data => {
|
| 23 |
+
// Hacer algo con los datos, por ejemplo, mostrarlos en un elemento HTML
|
| 24 |
+
document.getElementById('miDiv').textContent = data.mensaje;
|
| 25 |
+
});
|
| 26 |
+
</script>
|
| 27 |
+
<style>
|
| 28 |
+
/* Estilos generales */
|
| 29 |
+
body {
|
| 30 |
+
font-family: Arial, sans-serif;
|
| 31 |
+
line-height: 1.5rem;
|
| 32 |
+
margin: 0;
|
| 33 |
+
padding: 0;
|
| 34 |
+
}
|
| 35 |
+
|
| 36 |
+
/* Contenedor principal */
|
| 37 |
+
.contenedor {
|
| 38 |
+
max-width: 600px;
|
| 39 |
+
padding: 30px;
|
| 40 |
+
margin: 0 auto;
|
| 41 |
+
}
|
| 42 |
+
|
| 43 |
+
/* T铆tulo */
|
| 44 |
+
h1 {
|
| 45 |
+
font-size: 1.5rem;
|
| 46 |
+
margin-bottom: 30px;
|
| 47 |
+
text-align: center;
|
| 48 |
+
}
|
| 49 |
+
|
| 50 |
+
/* Consulta */
|
| 51 |
+
#consulta {
|
| 52 |
+
width: 100%;
|
| 53 |
+
height: 200px;
|
| 54 |
+
padding: 10px;
|
| 55 |
+
border: 1px solid #ccc;
|
| 56 |
+
border-radius: 5px;
|
| 57 |
+
}
|
| 58 |
+
|
| 59 |
+
/* Bot贸n de consulta */
|
| 60 |
+
#botonConsulta {
|
| 61 |
+
display: block;
|
| 62 |
+
margin: 30px auto 0 auto;
|
| 63 |
+
padding: 10px 20px;
|
| 64 |
+
border: 1px solid #000;
|
| 65 |
+
border-radius: 5px;
|
| 66 |
+
background-color: #000;
|
| 67 |
+
color: #fff;
|
| 68 |
+
cursor: pointer;
|
| 69 |
+
}
|
| 70 |
+
|
| 71 |
+
/* Resultados de la consulta */
|
| 72 |
+
#resultadoConsulta {
|
| 73 |
+
background-color: #eee;
|
| 74 |
+
padding: 10px;
|
| 75 |
+
margin-top: 30px;
|
| 76 |
+
font-family: monospace;
|
| 77 |
+
}
|
| 78 |
+
|
| 79 |
+
/* Cargando... */
|
| 80 |
+
.loading {
|
| 81 |
+
color: #666;
|
| 82 |
+
font-size: 1.2rem;
|
| 83 |
+
text-align: center;
|
| 84 |
+
}
|
| 85 |
+
</style>
|
| 86 |
+
</head>
|
| 87 |
+
|
| 88 |
+
<body>
|
| 89 |
+
<div class="contenedor">
|
| 90 |
+
<h1>Formulario de Consulta a GEMINI</h1>
|
| 91 |
+
<div>
|
| 92 |
+
<textarea id="consulta"></textarea>
|
| 93 |
+
</div>
|
| 94 |
+
<button type="button" id="botonConsulta">Consultar</button>
|
| 95 |
+
<pre id="resultadoConsulta"></pre>
|
| 96 |
+
</div>
|
| 97 |
+
|
| 98 |
+
<script type="importmap">
|
| 99 |
+
{
|
| 100 |
+
"imports": {
|
| 101 |
+
"@google/generative-ai": "https://esm.run/@google/generative-ai"
|
| 102 |
+
}
|
| 103 |
+
}
|
| 104 |
+
</script>
|
| 105 |
+
|
| 106 |
+
<script type="module">
|
| 107 |
+
import { GoogleGenerativeAI } from "@google/generative-ai"
|
| 108 |
+
const clave = "AIzaSyCCrYXob4qnWmqvhjBnF7UUmbKb99rApeQ" // copiar su clave
|
| 109 |
+
|
| 110 |
+
const genAI = new GoogleGenerativeAI(clave)
|
| 111 |
+
const model = genAI.getGenerativeModel({ model: "gemini-pro" })
|
| 112 |
+
|
| 113 |
+
document.querySelector("#botonConsulta").addEventListener("click", async () => {
|
| 114 |
+
desactivarBoton()
|
| 115 |
+
const consulta = document.querySelector("#consulta").value
|
| 116 |
+
const resultadoConsulta = document.querySelector("#resultadoConsulta")
|
| 117 |
+
try {
|
| 118 |
+
const result = await model.generateContent(consulta)
|
| 119 |
+
const response = await result.response
|
| 120 |
+
const text = response.text()
|
| 121 |
+
resultadoConsulta.innerHTML = text
|
| 122 |
+
} catch (error) {
|
| 123 |
+
resultadoConsulta.innerHTML = 'Problemas en la consulta'
|
| 124 |
+
}
|
| 125 |
+
activarBoton()
|
| 126 |
+
})
|
| 127 |
+
|
| 128 |
+
function desactivarBoton() {
|
| 129 |
+
const botonConsulta = document.querySelector("#botonConsulta")
|
| 130 |
+
botonConsulta.disabled = true
|
| 131 |
+
botonConsulta.innerText = "Consultando..."
|
| 132 |
+
}
|
| 133 |
+
|
| 134 |
+
function activarBoton() {
|
| 135 |
+
const botonConsulta = document.querySelector("#botonConsulta")
|
| 136 |
+
botonConsulta.disabled = false
|
| 137 |
+
botonConsulta.innerText = "Consultar"
|
| 138 |
+
}
|
| 139 |
+
</script>
|
| 140 |
+
</body>
|
| 141 |
+
|
| 142 |
+
</html>
|
| 143 |
+
---
|
| 144 |
+
license: llama3.1
|
| 145 |
+
---
|