Skip to content

Commit 92e342b

Browse files
chore: ER LLM platform is now the the default endpoint
1 parent 7982cfd commit 92e342b

3 files changed

Lines changed: 14 additions & 29 deletions

File tree

app/nlpui.html

Lines changed: 8 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
<title>NLP Prototype - Algorithmic Justice</title>
77
<link rel="icon" href="data:," >
88
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bulma@1.0.4/css/bulma.min.css">
9+
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
910
<script src="https://unpkg.com/vue@3/dist/vue.global.js"></script>
1011
<script src="https://unpkg.com/@popperjs/core@2"></script>
1112
<script src="https://unpkg.com/tippy.js@6"></script>
@@ -32,15 +33,18 @@
3233
<p :class="['notification', 'is-light', `is-${message.level}`, `${message.content ? '' : 'in'}visible`]">{{ message.content }}</p>
3334
<div class="tabs is-medium">
3435
<ul>
35-
<li v-for="(tab, tabKey) in tabs" @click="onClickTab(tabKey)" :class="{'is-active': tabKey === selectedTab}"><a>{{ tab.title }}</a></li>
36+
<li v-for="(tab, tabKey) in tabs" @click="onClickTab(tabKey)" :class="{'is-active': tabKey === selectedTab}">
37+
<a>
38+
<span v-if="!isServiceWorking && tabKey == 'settings'" class="icon is-small"><i class="fa fa-exclamation-triangle" aria-hidden="true"></i></span>
39+
{{ tab.title }}
40+
</a>
41+
</li>
3642
</ul>
3743
</div>
3844
<div v-show="selectedTab == 'settings'" id="tab-settings">
3945
<form class="form">
4046
<div v-for="(setting, settingKey) in settings" class="field">
41-
<!-- <div class="field-label is-normal"> -->
42-
<label class="label" :for="`stg-${settingKey}`">{{ setting.label }}:</label>
43-
<!-- </div> -->
47+
<label class="label" :for="`stg-${settingKey}`">{{ setting.label }}:</label>
4448
<div class="field-body">
4549
<div class="field">
4650
<p class="control">
@@ -64,19 +68,6 @@ <h2 class="title is-3">Magistrate's question</h2>
6468
<h2 class="title is-3">Defendant's statement (with LLM's highlights)</h2>
6569
<div class="highlighted-text" v-html="higlightedText">
6670
</div>
67-
<!-- <br>
68-
<div class="settings">
69-
<h4 class="title is-4">Settings</h4>
70-
<ul>
71-
<li>Model:
72-
<select v-model="settings.model" @change="updateQueryString()">
73-
<option v-for="model in modelsList">{{model}}</option>
74-
</select>
75-
</li>
76-
<li>Context: {{settings.contextLength}}</li>
77-
<li>Ollama: {{settings.serviceUrl}}</li>
78-
</ul>
79-
</div> -->
8071
</div>
8172
</div>
8273
</div>

app/nlpui.js

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -64,15 +64,9 @@ createApp({
6464

6565
this.initService()
6666

67-
// this.fetchModelsList()
68-
69-
// this.apiKey = sessionStorage.getItem('apiKey') ?? '';
70-
71-
// const params = new URLSearchParams(window.location.search);
72-
// this.question = params.get('q') ?? DEFAULT_QUESTION;
73-
// this.settings.model = params.get('model') ?? this.settings.model;
74-
75-
// this.sendPrompt()
67+
if (this.isServiceWorking) {
68+
this.sendPrompt()
69+
}
7670
},
7771
computed: {
7872
settingsFiltered() {
@@ -115,7 +109,7 @@ createApp({
115109
return this.modelsList
116110
},
117111
async initService() {
118-
let res = this.fetchModelsList()
112+
let res = await this.fetchModelsList()
119113
this.isServiceWorking = (res && res?.length > 0)
120114
},
121115
async sendToService(path, body) {

app/settings.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,8 @@ const SETTINGS = {
7878
lookup: 'getModelsList',
7979
},
8080
serviceUrl: {
81-
//default: "https://ai.create.kcl.ac.uk/api/",
82-
default: "http://localhost:11434/v1",
81+
default: "https://ai.create" + ".kcl.ac.uk/api/",
82+
// default: "http://localhost:11434/v1",
8383
inQueryString: true,
8484
},
8585
apiKey: {

0 commit comments

Comments
 (0)