diff --git a/src/app/pages/ai/ai.page.ts b/src/app/pages/ai/ai.page.ts
index c84aeb0..cc97c74 100644
--- a/src/app/pages/ai/ai.page.ts
+++ b/src/app/pages/ai/ai.page.ts
@@ -12,17 +12,39 @@ export class AiPage implements OnInit {
answer: string | undefined;
+ model = getGenerativeModel(this.vertexAI, {model: "gemini-1.5-flash"});
+ chat = this.model.startChat({
+ history: [
+ {
+ role: "user",
+ parts: [{text:"Hola, desde ahora en adelante quiero que seas un modelo experto en Software Quality Assurance y analista de datos"}],
+ },
+ {
+ role: "model",
+ parts: [{text:"Soy un modelo experto en Software Quality Assurance, de igual forma tengo un masterado en anlaítica de datos ¿En qué puedo ayudarte?"}],
+ },
+ {
+ role: "user",
+ parts: [{text:"Gracias, te voy a entregar un json con datos en unos minutos, necesito que lo analices y me des un resumen de los datos, este json contiene datos del uso de cpu, imagina que " +
+ "que es un json donde se monitorea al servidor, tu analisis tiene que ser detallado, si encuentras inconsistencias en los datos, por favor mencionalas, en " +
+ "caso de que creas que ocurrio un ataque cibernetico menciona el posible ataque, si crees que hay pocos datos para hacer un verdadero analisis mencionalo "}],
+ },
+ {
+ role: "model",
+ parts: [{text:"Claro, envíame el json y yo me encargo de analizarlo, desde ahora me voy a llamar DevProbeAI."}]
+ },
+ ],
+ });
+
+
constructor() { }
ngOnInit() {
}
- askQuestionNow() {
- const model = getGenerativeModel(this.vertexAI, {model: "gemini-1.5-flash"});
- model.generateContent(this.question!).then(response => {
- console.log(response.response.text());
- this.answer = response.response.text();
- });
+ async askQuestionNow() {
+ const msg = this.question!;
+ const result = await this.chat.sendMessage(msg);
+ this.answer = result.response.text();
}
-
}
diff --git a/src/app/pages/graph-trace/graph-trace.page.html b/src/app/pages/graph-trace/graph-trace.page.html
index b1a3091..bcf1e6e 100644
--- a/src/app/pages/graph-trace/graph-trace.page.html
+++ b/src/app/pages/graph-trace/graph-trace.page.html
@@ -101,3 +101,4 @@
DevProbe AI
+
diff --git a/www/4348.42c6e9d271a54882.js b/www/4348.42c6e9d271a54882.js
new file mode 100644
index 0000000..8c23a28
--- /dev/null
+++ b/www/4348.42c6e9d271a54882.js
@@ -0,0 +1 @@
+"use strict";(self.webpackChunkapp=self.webpackChunkapp||[]).push([[4348],{4348:(v,c,t)=>{t.r(c),t.d(c,{AiPageModule:()=>y});var p=t(177),d=t(4341),a=t(7863),g=t(305),h=t(467),e=t(4438),m=t(9032);const A=[{path:"",component:(()=>{var n;class i{constructor(){this.vertexAI=(0,e.WQX)(m.L9),this.model=(0,m.oc)(this.vertexAI,{model:"gemini-1.5-flash"}),this.chat=this.model.startChat({history:[{role:"user",parts:[{text:"Hola, desde ahora en adelante quiero que seas un modelo experto en Software Quality Assurance y analista de datos"}]},{role:"model",parts:[{text:"Soy un modelo experto en Software Quality Assurance, de igual forma tengo un masterado en anla\xedtica de datos \xbfEn qu\xe9 puedo ayudarte?"}]},{role:"user",parts:[{text:"Gracias, te voy a entregar un json con datos en unos minutos, necesito que lo analices y me des un resumen de los datos, este json contiene datos del uso de cpu, imagina que que es un json donde se monitorea al servidor, tu analisis tiene que ser detallado, si encuentras inconsistencias en los datos, por favor mencionalas, en caso de que creas que ocurrio un ataque cibernetico menciona el posible ataque, si crees que hay pocos datos para hacer un verdadero analisis mencionalo "}]},{role:"model",parts:[{text:"Claro, env\xedame el json y yo me encargo de analizarlo, desde ahora me voy a llamar DevProbeAI."}]}]})}ngOnInit(){}askQuestionNow(){var o=this;return(0,h.A)(function*(){const s=o.question,u=yield o.chat.sendMessage(s);o.answer=u.response.text()})()}}return(n=i).\u0275fac=function(o){return new(o||n)},n.\u0275cmp=e.VBU({type:n,selectors:[["app-ai"]],decls:17,vars:4,consts:[[3,"translucent"],[3,"fullscreen"],["collapse","condense"],["size","large"],["size","12","size-md","12","size-lg","12"],["label","Enter a question","placeholder","Enter a question","type","text","labelPlacement","stacked",1,"",3,"ngModelChange","ngModel"],["color","primary",1,"m-4",3,"click"],["label","Answer","placeholder","Answer","labelPlacement","stacked",1,"",3,"ngModelChange","ngModel"]],template:function(o,s){1&o&&(e.j41(0,"ion-header",0)(1,"ion-toolbar")(2,"ion-title"),e.EFF(3,"ai"),e.k0s()()(),e.j41(4,"ion-content",1)(5,"ion-header",2)(6,"ion-toolbar")(7,"ion-title",3),e.EFF(8,"ai"),e.k0s()()(),e.j41(9,"ion-grid")(10,"ion-row")(11,"ion-col",4)(12,"ion-input",5),e.mxI("ngModelChange",function(r){return e.DH7(s.question,r)||(s.question=r),r}),e.k0s(),e.j41(13,"ion-button",6),e.bIt("click",function(){return s.askQuestionNow()}),e.EFF(14,"Ask"),e.k0s()(),e.j41(15,"ion-col",4)(16,"ion-textarea",7),e.mxI("ngModelChange",function(r){return e.DH7(s.answer,r)||(s.answer=r),r}),e.k0s()()()()()),2&o&&(e.Y8G("translucent",!0),e.R7$(4),e.Y8G("fullscreen",!0),e.R7$(8),e.R50("ngModel",s.question),e.R7$(4),e.R50("ngModel",s.answer))},dependencies:[d.BC,d.vS,a.Jm,a.hU,a.W9,a.lO,a.eU,a.$w,a.ln,a.nc,a.BC,a.ai,a.Gw]}),i})()}];let f=(()=>{var n;class i{}return(n=i).\u0275fac=function(o){return new(o||n)},n.\u0275mod=e.$C({type:n}),n.\u0275inj=e.G2t({imports:[g.iI.forChild(A),g.iI]}),i})(),y=(()=>{var n;class i{}return(n=i).\u0275fac=function(o){return new(o||n)},n.\u0275mod=e.$C({type:n}),n.\u0275inj=e.G2t({imports:[p.MD,d.YN,a.bv,f]}),i})()}}]);
\ No newline at end of file
diff --git a/www/4348.fd00493c5150e85d.js b/www/4348.fd00493c5150e85d.js
deleted file mode 100644
index c15d330..0000000
--- a/www/4348.fd00493c5150e85d.js
+++ /dev/null
@@ -1 +0,0 @@
-"use strict";(self.webpackChunkapp=self.webpackChunkapp||[]).push([[4348],{4348:(M,g,a)=>{a.r(g),a.d(g,{AiPageModule:()=>f});var p=a(177),u=a(4341),o=a(7863),c=a(305),e=a(4438),d=a(9032);const A=[{path:"",component:(()=>{var n;class l{constructor(){this.vertexAI=(0,e.WQX)(d.L9)}ngOnInit(){}askQuestionNow(){(0,d.oc)(this.vertexAI,{model:"gemini-1.5-flash"}).generateContent(this.question).then(t=>{console.log(t.response.text()),this.answer=t.response.text()})}}return(n=l).\u0275fac=function(i){return new(i||n)},n.\u0275cmp=e.VBU({type:n,selectors:[["app-ai"]],decls:17,vars:4,consts:[[3,"translucent"],[3,"fullscreen"],["collapse","condense"],["size","large"],["size","12","size-md","12","size-lg","12"],["label","Enter a question","placeholder","Enter a question","type","text","labelPlacement","stacked",1,"",3,"ngModelChange","ngModel"],["color","primary",1,"m-4",3,"click"],["label","Answer","placeholder","Answer","labelPlacement","stacked",1,"",3,"ngModelChange","ngModel"]],template:function(i,t){1&i&&(e.j41(0,"ion-header",0)(1,"ion-toolbar")(2,"ion-title"),e.EFF(3,"ai"),e.k0s()()(),e.j41(4,"ion-content",1)(5,"ion-header",2)(6,"ion-toolbar")(7,"ion-title",3),e.EFF(8,"ai"),e.k0s()()(),e.j41(9,"ion-grid")(10,"ion-row")(11,"ion-col",4)(12,"ion-input",5),e.mxI("ngModelChange",function(s){return e.DH7(t.question,s)||(t.question=s),s}),e.k0s(),e.j41(13,"ion-button",6),e.bIt("click",function(){return t.askQuestionNow()}),e.EFF(14,"Ask"),e.k0s()(),e.j41(15,"ion-col",4)(16,"ion-textarea",7),e.mxI("ngModelChange",function(s){return e.DH7(t.answer,s)||(t.answer=s),s}),e.k0s()()()()()),2&i&&(e.Y8G("translucent",!0),e.R7$(4),e.Y8G("fullscreen",!0),e.R7$(8),e.R50("ngModel",t.question),e.R7$(4),e.R50("ngModel",t.answer))},dependencies:[u.BC,u.vS,o.Jm,o.hU,o.W9,o.lO,o.eU,o.$w,o.ln,o.nc,o.BC,o.ai,o.Gw]}),l})()}];let h=(()=>{var n;class l{}return(n=l).\u0275fac=function(i){return new(i||n)},n.\u0275mod=e.$C({type:n}),n.\u0275inj=e.G2t({imports:[c.iI.forChild(A),c.iI]}),l})(),f=(()=>{var n;class l{}return(n=l).\u0275fac=function(i){return new(i||n)},n.\u0275mod=e.$C({type:n}),n.\u0275inj=e.G2t({imports:[p.MD,u.YN,o.bv,h]}),l})()}}]);
\ No newline at end of file
diff --git a/www/index.html b/www/index.html
index d1302af..2a2abf8 100644
--- a/www/index.html
+++ b/www/index.html
@@ -21,6 +21,6 @@
-
+