:gem: [Feature] New temperature select
Browse files
apps/llm_mixer/index.html
CHANGED
@@ -22,34 +22,47 @@
|
|
22 |
<div class="container">
|
23 |
<div id="messagers-container" class="container mt-3"></div>
|
24 |
<div id="user-interactions" class="container fixed-bottom mb-3">
|
25 |
-
<div class="mt-2">
|
26 |
<div class="col-auto">
|
27 |
<select
|
28 |
class="form-select"
|
29 |
id="available-models-select"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
30 |
></select>
|
31 |
</div>
|
32 |
</div>
|
33 |
-
<div class="mt-2">
|
34 |
-
<div class="
|
35 |
-
<
|
36 |
-
<
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
<
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
<
|
49 |
-
<
|
50 |
-
|
51 |
-
</button>
|
52 |
-
</div>
|
53 |
</div>
|
54 |
</div>
|
55 |
<div class="mt-3">
|
|
|
22 |
<div class="container">
|
23 |
<div id="messagers-container" class="container mt-3"></div>
|
24 |
<div id="user-interactions" class="container fixed-bottom mb-3">
|
25 |
+
<div class="mt-2 row no-gutters">
|
26 |
<div class="col-auto">
|
27 |
<select
|
28 |
class="form-select"
|
29 |
id="available-models-select"
|
30 |
+
title="Available Models"
|
31 |
+
></select>
|
32 |
+
</div>
|
33 |
+
<div class="col-auto">
|
34 |
+
<select
|
35 |
+
class="form-select"
|
36 |
+
id="temperature-select"
|
37 |
+
title="Temperature"
|
38 |
+
></select>
|
39 |
+
</div>
|
40 |
+
<div class="col-4">
|
41 |
+
<select
|
42 |
+
class="form-select"
|
43 |
+
id="chat-history-select"
|
44 |
+
title="Chat History"
|
45 |
></select>
|
46 |
</div>
|
47 |
</div>
|
48 |
+
<div class="mt-2 row no-gutters">
|
49 |
+
<div class="col-auto pl-3 pr-0">
|
50 |
+
<button id="new-chat-session" class="btn px-0">
|
51 |
+
<i class="fa fa-circle-plus"></i>
|
52 |
+
</button>
|
53 |
+
</div>
|
54 |
+
<div class="col px-0">
|
55 |
+
<textarea
|
56 |
+
id="user-input"
|
57 |
+
class="form-control"
|
58 |
+
rows="1"
|
59 |
+
placeholder="Typing here ..."
|
60 |
+
></textarea>
|
61 |
+
</div>
|
62 |
+
<div class="col-auto pr-3 pl-0">
|
63 |
+
<button id="send-user-input" class="btn px-0">
|
64 |
+
<i class="fa fa-paper-plane"></i>
|
65 |
+
</button>
|
|
|
|
|
66 |
</div>
|
67 |
</div>
|
68 |
<div class="mt-3">
|
apps/llm_mixer/js/chat_operator.js
CHANGED
@@ -2,8 +2,8 @@ import { Messager, MessagerList } from "./messager.js";
|
|
2 |
|
3 |
let messagers_container = $("#messagers-container");
|
4 |
let messager_list = new MessagerList(messagers_container);
|
5 |
-
|
6 |
let available_models_select = $("#available-models-select");
|
|
|
7 |
|
8 |
export function create_messager(
|
9 |
role,
|
@@ -25,6 +25,10 @@ export function get_selected_llm_model() {
|
|
25 |
return available_models_select.val();
|
26 |
}
|
27 |
|
|
|
|
|
|
|
|
|
28 |
export function get_latest_messager_container() {
|
29 |
return messager_list.messagers_container.children().last();
|
30 |
}
|
|
|
2 |
|
3 |
let messagers_container = $("#messagers-container");
|
4 |
let messager_list = new MessagerList(messagers_container);
|
|
|
5 |
let available_models_select = $("#available-models-select");
|
6 |
+
let temperature_select = $("#temperature-select");
|
7 |
|
8 |
export function create_messager(
|
9 |
role,
|
|
|
25 |
return available_models_select.val();
|
26 |
}
|
27 |
|
28 |
+
export function get_selected_temperature() {
|
29 |
+
return temperature_select.val();
|
30 |
+
}
|
31 |
+
|
32 |
export function get_latest_messager_container() {
|
33 |
return messager_list.messagers_container.children().last();
|
34 |
}
|
apps/llm_mixer/js/llm_models_loader.js
CHANGED
@@ -17,3 +17,20 @@ export async function setup_available_models_on_select(default_option = null) {
|
|
17 |
});
|
18 |
console.log(`Default model: ${select.val()}`);
|
19 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
17 |
});
|
18 |
console.log(`Default model: ${select.val()}`);
|
19 |
}
|
20 |
+
|
21 |
+
export async function setup_temperature_on_select(default_option = null) {
|
22 |
+
var select = $("#temperature-select");
|
23 |
+
select.empty();
|
24 |
+
if (default_option === null) {
|
25 |
+
default_option = "0";
|
26 |
+
}
|
27 |
+
for (let i = 10; i >= 0; i--) {
|
28 |
+
const value = i / 10;
|
29 |
+
const option = new Option(value, value);
|
30 |
+
select.append(option);
|
31 |
+
if (value === Number(default_option)) {
|
32 |
+
$(option).prop("selected", true);
|
33 |
+
}
|
34 |
+
}
|
35 |
+
console.log(`Default temperature: ${select.val()}`);
|
36 |
+
}
|
apps/llm_mixer/js/main.js
CHANGED
@@ -1,4 +1,7 @@
|
|
1 |
-
import {
|
|
|
|
|
|
|
2 |
import { ButtonsBinder } from "./buttons_binder.js";
|
3 |
var user_input_history = [];
|
4 |
var user_input_history_idx = 0;
|
@@ -30,6 +33,7 @@ function register_user_input_callbacks() {
|
|
30 |
// console.log(user_input_history);
|
31 |
// request_llm();
|
32 |
setup_available_models_on_select();
|
|
|
33 |
let buttons_binder = new ButtonsBinder();
|
34 |
buttons_binder.bind();
|
35 |
|
|
|
1 |
+
import {
|
2 |
+
setup_available_models_on_select,
|
3 |
+
setup_temperature_on_select,
|
4 |
+
} from "./llm_models_loader.js";
|
5 |
import { ButtonsBinder } from "./buttons_binder.js";
|
6 |
var user_input_history = [];
|
7 |
var user_input_history_idx = 0;
|
|
|
33 |
// console.log(user_input_history);
|
34 |
// request_llm();
|
35 |
setup_available_models_on_select();
|
36 |
+
setup_temperature_on_select();
|
37 |
let buttons_binder = new ButtonsBinder();
|
38 |
buttons_binder.bind();
|
39 |
|