Hansimov commited on
Commit
ed18d7d
·
1 Parent(s): ac03bb3

:boom: [Fix] Set animation of wrong generation icon

Browse files
apps/llm_mixer/js/buttons_binder.js CHANGED
@@ -47,6 +47,8 @@ export class ButtonsBinder {
47
  let user_input_content = $("#user-input").val();
48
  console.log(user_input_content);
49
  this.requester = new ChatCompletionsRequester(user_input_content);
 
 
50
  await this.requester.post();
51
  }
52
 
@@ -58,7 +60,6 @@ export class ButtonsBinder {
58
  .removeClass()
59
  .addClass("fa fa-circle-pause fa-fade")
60
  .css("color", "orange");
61
- start_latest_message_animation();
62
  await this.post_user_input();
63
  await this.stop(button);
64
  }
 
47
  let user_input_content = $("#user-input").val();
48
  console.log(user_input_content);
49
  this.requester = new ChatCompletionsRequester(user_input_content);
50
+ this.requester.create_messager_components();
51
+ start_latest_message_animation();
52
  await this.requester.post();
53
  }
54
 
 
60
  .removeClass()
61
  .addClass("fa fa-circle-pause fa-fade")
62
  .css("color", "orange");
 
63
  await this.post_user_input();
64
  await this.stop(button);
65
  }
apps/llm_mixer/js/llm_requester.js CHANGED
@@ -54,9 +54,11 @@ export class ChatCompletionsRequester {
54
  signal: this.controller.signal,
55
  };
56
  }
57
- post() {
58
  create_messager("user", this.prompt);
59
  create_messager("assistant", "", this.model, this.temperature);
 
 
60
  this.construct_request_params();
61
  return fetch(this.request_endpoint, this.request_params)
62
  .then((response) => response.body)
 
54
  signal: this.controller.signal,
55
  };
56
  }
57
+ create_messager_components() {
58
  create_messager("user", this.prompt);
59
  create_messager("assistant", "", this.model, this.temperature);
60
+ }
61
+ post() {
62
  this.construct_request_params();
63
  return fetch(this.request_endpoint, this.request_params)
64
  .then((response) => response.body)