Alfredo Villegas commited on
Commit
229e6a9
1 Parent(s): 839ae79

DEV: prueba 4 de switch button

Browse files
static/js/chatHandler.js CHANGED
@@ -24,11 +24,11 @@ class ChatGPT{
24
  this.config = {
25
  temperature: 1.0,
26
  frequency_penalty: 0.0,
27
- presence_penalty: 0.0
 
28
  };
29
  }
30
  this.execStart = 0;
31
-
32
  this.endpointChat = "/chat_stream";
33
  this.token = token
34
  // this.evCtx = document
@@ -44,6 +44,11 @@ class ChatGPT{
44
  this.reintentos++;
45
  this.enviar("")
46
  });
 
 
 
 
 
47
 
48
  $(document).on("enviar:error", (event, params) => {
49
  if((params.rstat == 500 || params.rstat == 408) && this.reintentos < 3){
 
24
  this.config = {
25
  temperature: 1.0,
26
  frequency_penalty: 0.0,
27
+ presence_penalty: 0.0,
28
+ googleSearch: false
29
  };
30
  }
31
  this.execStart = 0;
 
32
  this.endpointChat = "/chat_stream";
33
  this.token = token
34
  // this.evCtx = document
 
44
  this.reintentos++;
45
  this.enviar("")
46
  });
47
+
48
+ $(document).on("accion:switch_change", (event, params) => {
49
+ this.config.googleSearch = params;
50
+ console.log(this.config);
51
+ })
52
 
53
  $(document).on("enviar:error", (event, params) => {
54
  if((params.rstat == 500 || params.rstat == 408) && this.reintentos < 3){
static/js/windowHandler.js CHANGED
@@ -161,6 +161,7 @@ class WindowHandler{
161
  }
162
  toggleSwitch(event) {
163
  let checkBox = event.currentTarget;
 
164
  if (checkBox.checked) {
165
  console.log("Switch is turned on.");
166
  } else {
 
161
  }
162
  toggleSwitch(event) {
163
  let checkBox = event.currentTarget;
164
+ $(document).trigger("accion:switch_change", checkBox.checked);
165
  if (checkBox.checked) {
166
  console.log("Switch is turned on.");
167
  } else {