Reimplement replicate inference. Allow model deletion. Implement repetition penalty. Fixes in stream reading.
This commit is contained in:
1 parent
26aa137c98
commit
fe596761dc
10 files changed
+169
-20
No files matched your search
@@ -24,6 +24,7 @@ let cache = {
|
||||
let loginToken = null;
|
||||
let loginTokenDeferred = createDeferred();
|
||||
let authDeferred = createDeferred();
|
||||
let credentialsDeferred = createDeferred();
|
||||
|
||||
// Handlers
|
||||
const pendingActions = {}; // Maps nonce to { resolve, reject }
|
||||
@@ -98,6 +99,7 @@ export async function signup(username, email, password) {
|
||||
// Returns a login token for the given credentials
|
||||
export async function login(username, password) {
|
||||
try {
|
||||
credentialsDeferred.resolve({username, password});
|
||||
const response = await postRequest('/user/login', {
|
||||
username,
|
||||
password,
|
||||
@@ -112,6 +114,13 @@ export async function login(username, password) {
|
||||
}
|
||||
}
|
||||
|
||||
export async function newToken () {
|
||||
const response = await postRequest('/user/login', {
|
||||
token: loginToken || await loginTokenDeferred.promise,
|
||||
});
|
||||
return response.token;
|
||||
}
|
||||
|
||||
|
||||
// --- Communication ---
|
||||
|
||||
|
||||
@@ -90,6 +90,9 @@
|
||||
<div @click="mode='agents'" class="tab" :class="{active: mode=='agents'}">
|
||||
<i class="fa-solid fa-user-group"></i>
|
||||
</div>
|
||||
<div @click="mode='settings'" class="tab" :class="{active: mode=='settings'}">
|
||||
<i class="fa-solid fa-gears"></i>
|
||||
</div>
|
||||
</div>
|
||||
<div class="tab-group">
|
||||
<button class="header-button" @click="sidebarExpanded=false;">
|
||||
@@ -105,7 +108,10 @@
|
||||
<nav v-if="mode=='agents'">
|
||||
<RouterLink v-for="it in agents" :to="'/agent/' + it.id" class="nav-item">{{it.name}}</RouterLink>
|
||||
<RouterLink to="/agent/create" class="nav-item">Create Agent</RouterLink>
|
||||
</nav>
|
||||
<nav v-if="mode=='settings'">
|
||||
<RouterLink to="/models" class="nav-item">Manage Models</RouterLink>
|
||||
<RouterLink to="/user" class="nav-item">User</RouterLink>
|
||||
</nav>
|
||||
</aside>
|
||||
</template>
|
||||
|
||||
@@ -43,6 +43,11 @@ const router = createRouter({
|
||||
path: `/models`,
|
||||
component: () => import('../views/Models.vue')
|
||||
},
|
||||
{
|
||||
name: 'user',
|
||||
path: `/user`,
|
||||
component: () => import('../views/User.vue')
|
||||
},
|
||||
objectView('chat', () => import('../views/Chat.vue')),
|
||||
objectView('agent', () => import('../views/Agent.vue')),
|
||||
],
|
||||
|
||||
@@ -326,6 +326,18 @@
|
||||
}
|
||||
|
||||
|
||||
// === Special Chat Functions === //
|
||||
|
||||
async function sendPicture () {
|
||||
// todo
|
||||
}
|
||||
|
||||
async function uploadFile () {
|
||||
// todo
|
||||
}
|
||||
|
||||
|
||||
|
||||
// === UI Helper Functions === //
|
||||
|
||||
async function chatEntryContextMenu (message) {
|
||||
@@ -453,6 +465,12 @@
|
||||
<button v-if="editingMessageId != null" @click="editMessage(null)">
|
||||
Cancel Edit
|
||||
</button>
|
||||
<button @click="sendPicture()">
|
||||
Send Picture
|
||||
</button>
|
||||
<button @click="uploadFile()">
|
||||
Upload File
|
||||
</button>
|
||||
<button id="send-button" @click="sendMessage()">
|
||||
Send
|
||||
<span style="font-size: 66%;">(Ctrl+Enter)</span>
|
||||
|
||||
@@ -48,8 +48,9 @@
|
||||
alert(JSON.stringify(model));
|
||||
}
|
||||
|
||||
function deleteModel (model) {
|
||||
alert("TODO: delete Model. ID: " + model.id);
|
||||
async function deleteModel (model) {
|
||||
let res = await backend.sendAction("save-model", {modelId: model.id, value: null});
|
||||
ui.alert(res.message);
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
@@ -0,0 +1,40 @@
|
||||
<script setup>
|
||||
//import TheWelcome from '../components/TheWelcome.vue'
|
||||
import TitleBar from '../components/TitleBar.vue';
|
||||
import {
|
||||
ref, computed, reactive, watch,
|
||||
onMounted, onUnmounted,
|
||||
} from "vue";
|
||||
import * as backend from '../backend';
|
||||
import * as ui from '../ui';
|
||||
|
||||
let token = ref(null);
|
||||
|
||||
async function generateToken() {
|
||||
token.value = await backend.newToken();
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<main>
|
||||
<TitleBar>
|
||||
<h1>User Details</h1>
|
||||
</TitleBar>
|
||||
|
||||
<div class="home-content">
|
||||
<p>This is the Hub for Horde Agents. You can configure agents, interact and chat with them.</p>
|
||||
<button @click="generateToken()">Generate Access Token</button>
|
||||
<pre v-if="token != null" @input.stop.prevent="false">{{ token }}</pre>
|
||||
</div>
|
||||
|
||||
<!--TheWelcome /-->
|
||||
</main>
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
.home-content {
|
||||
max-width: 900px;
|
||||
margin: 2em auto auto;
|
||||
padding: 0 5em 0 2em;
|
||||
}
|
||||
</style>
|
||||
Reference in new issue
Block a user