:gem: [Feature] New notes model for taking notes
Browse files- components/buttons_binder.js +11 -5
- networks/llm_requester.js +2 -5
components/buttons_binder.js
CHANGED
@@ -4,6 +4,8 @@ import {
|
|
4 |
start_latest_message_animation,
|
5 |
create_new_chat_session,
|
6 |
get_latest_message_content_displayer,
|
|
|
|
|
7 |
} from "./chat_operator.js";
|
8 |
import { setup_available_models_on_select } from "./llm_models_loader.js";
|
9 |
|
@@ -81,11 +83,15 @@ class SendUserInputButtonBinder {
|
|
81 |
async post_user_input() {
|
82 |
let user_input_content = $("#user-input").val();
|
83 |
console.log(user_input_content);
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
|
|
|
|
|
|
|
|
|
89 |
}
|
90 |
|
91 |
async stop(button) {
|
|
|
4 |
start_latest_message_animation,
|
5 |
create_new_chat_session,
|
6 |
get_latest_message_content_displayer,
|
7 |
+
get_selected_llm_model,
|
8 |
+
create_messager,
|
9 |
} from "./chat_operator.js";
|
10 |
import { setup_available_models_on_select } from "./llm_models_loader.js";
|
11 |
|
|
|
83 |
async post_user_input() {
|
84 |
let user_input_content = $("#user-input").val();
|
85 |
console.log(user_input_content);
|
86 |
+
if (get_selected_llm_model() == "notes") {
|
87 |
+
create_messager("user", user_input_content);
|
88 |
+
} else {
|
89 |
+
this.requester = new ChatCompletionsRequester(user_input_content);
|
90 |
+
this.requester.create_messager_components();
|
91 |
+
start_latest_message_animation();
|
92 |
+
await this.requester.post();
|
93 |
+
this.requester.stop();
|
94 |
+
}
|
95 |
}
|
96 |
|
97 |
async stop(button) {
|
networks/llm_requester.js
CHANGED
@@ -98,12 +98,9 @@ export class ChatCompletionsRequester {
|
|
98 |
}
|
99 |
}
|
100 |
|
101 |
-
|
102 |
-
export var available_models = [];
|
103 |
export class AvailableModelsRequester {
|
104 |
-
constructor(
|
105 |
-
openai_endpoint = null
|
106 |
-
) {
|
107 |
this.openai_endpoint =
|
108 |
openai_endpoint || localStorage.getItem("openai_endpoint");
|
109 |
this.backend_request_endpoint = "/models";
|
|
|
98 |
}
|
99 |
}
|
100 |
|
101 |
+
export var available_models = ["notes"];
|
|
|
102 |
export class AvailableModelsRequester {
|
103 |
+
constructor(openai_endpoint = null) {
|
|
|
|
|
104 |
this.openai_endpoint =
|
105 |
openai_endpoint || localStorage.getItem("openai_endpoint");
|
106 |
this.backend_request_endpoint = "/models";
|