WIP: Prep 0.21.0 (#83)

* cleanup

* refactor clean_dialogue

* prompt fixes

* prompt fixes

* conversation format types - movie script and chat (legacy)

* stopping strings updated

* mistral.ai client

* prompt tweaks

* mistral client return token counts

* anthropic client

* archive history emits whole object so we can inspectr time stamps

* show timestamp in history dialog

* openai compat fixes to stop trying to coerce openai url path schema and to never attempt to retrieve the model name automatically, hopefully improving compatibility with the various openai api implementations across the board

* openai compat client let api control prompt template via config option

* fix custom client configs and implement max backscroll

* fix backscroll limit

* remove debug message

* prep 0.21.0

* include model name in prompt template selection label

* use tabs for side nav in app config modal

* readme / docs

* fix issue where "No API key set" could be persisted as the selected model name to the config

* deepinfra example

* linting
This commit is contained in:
veguAI
2024-03-10 18:03:12 +02:00
committed by GitHub
parent 2f07248211
commit abdfb1abbf
36 changed files with 1421 additions and 721 deletions

View File

@@ -1,12 +1,12 @@
{
"name": "talemate_frontend",
"version": "0.19.0",
"version": "0.21.0",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "talemate_frontend",
"version": "0.19.0",
"version": "0.21.0",
"dependencies": {
"@mdi/font": "7.4.47",
"core-js": "^3.8.3",

View File

@@ -1,6 +1,6 @@
{
"name": "talemate_frontend",
"version": "0.20.0",
"version": "0.21.0",
"private": true,
"scripts": {
"serve": "vue-cli-service serve",

View File

@@ -16,6 +16,7 @@
Creator
</v-tab>
</v-tabs>
<v-divider></v-divider>
<v-window v-model="tab">
<!-- GAME -->
@@ -25,11 +26,12 @@
<v-card-text>
<v-row>
<v-col cols="4">
<v-list>
<v-list-item @click="gamePageSelected=item.value" :prepend-icon="item.icon" v-for="(item, index) in navigation.game" :key="index">
<v-list-item-title>{{ item.title }}</v-list-item-title>
</v-list-item>
</v-list>
<v-tabs v-model="gamePageSelected" color="primary" direction="vertical">
<v-tab v-for="(item, index) in navigation.game" :key="index" :value="item.value">
<v-icon class="mr-1">{{ item.icon }}</v-icon>
{{ item.title }}
</v-tab>
</v-tabs>
</v-col>
<v-col cols="8">
<div v-if="gamePageSelected === 'general'">
@@ -45,6 +47,11 @@
<v-checkbox v-model="app_config.game.general.auto_save" label="Auto save" messages="Automatically save after each game-loop"></v-checkbox>
<v-checkbox v-model="app_config.game.general.auto_progress" label="Auto progress" messages="AI automatically progresses after player turn."></v-checkbox>
</v-col>
</v-row>
<v-row>
<v-col cols="6">
<v-text-field v-model="app_config.game.general.max_backscroll" type="number" label="Max backscroll" messages="Maximum number of messages to keep in the scene backscroll"></v-text-field>
</v-col>
</v-row>
</div>
<div v-else-if="gamePageSelected === 'character'">
@@ -88,9 +95,13 @@
<v-col cols="4">
<v-list>
<v-list-subheader>Third Party APIs</v-list-subheader>
<v-list-item @click="applicationPageSelected=item.value" :prepend-icon="item.icon" v-for="(item, index) in navigation.application" :key="index">
<v-list-item-title>{{ item.title }}</v-list-item-title>
</v-list-item>
<v-tabs v-model="applicationPageSelected" color="primary" direction="vertical" density="compact">
<v-tab v-for="(item, index) in navigation.application" :key="index" :value="item.value">
<v-icon class="mr-1">{{ item.icon }}</v-icon>
{{ item.title }}
</v-tab>
</v-tabs>
</v-list>
</v-col>
<v-col cols="8">
@@ -112,6 +123,40 @@
</v-row>
</div>
<!-- MISTRAL.AI API -->
<div v-if="applicationPageSelected === 'mistralai_api'">
<v-alert color="white" variant="text" icon="mdi-api" density="compact">
<v-alert-title>mistral.ai</v-alert-title>
<div class="text-grey">
Configure your mistral.ai API key here. You can get one from <a href="https://console.mistral.ai/api-keys/" target="_blank">https://console.mistral.ai/api-keys/</a>
</div>
</v-alert>
<v-divider class="mb-2"></v-divider>
<v-row>
<v-col cols="12">
<v-text-field type="password" v-model="app_config.mistralai.api_key"
label="mistral.ai API Key"></v-text-field>
</v-col>
</v-row>
</div>
<!-- ANTHROPIC API -->
<div v-if="applicationPageSelected === 'anthropic_api'">
<v-alert color="white" variant="text" icon="mdi-api" density="compact">
<v-alert-title>Anthropic</v-alert-title>
<div class="text-grey">
Configure your Anthropic API key here. You can get one from <a href="https://console.anthropic.com/settings/keys" target="_blank">https://console.anthropic.com/settings/keys</a>
</div>
</v-alert>
<v-divider class="mb-2"></v-divider>
<v-row>
<v-col cols="12">
<v-text-field type="password" v-model="app_config.anthropic.api_key"
label="Anthropic API Key"></v-text-field>
</v-col>
</v-row>
</div>
<!-- ELEVENLABS API -->
<div v-if="applicationPageSelected === 'elevenlabs_api'">
<v-alert color="white" variant="text" icon="mdi-api" density="compact">
@@ -130,23 +175,6 @@
</v-row>
</div>
<!-- COQUI API -->
<div v-if="applicationPageSelected === 'coqui_api'">
<v-alert color="white" variant="text" icon="mdi-api" density="compact">
<v-alert-title>Coqui Studio</v-alert-title>
<div class="text-grey">
<p class="mb-1">Realistic, emotive text-to-speech through generative AI.</p>
Configure your Coqui API key here. You can get one from <a href="https://app.coqui.ai/account" target="_blank">https://app.coqui.ai/account</a>
</div>
</v-alert>
<v-divider class="mb-2"></v-divider>
<v-row>
<v-col cols="12">
<v-text-field type="password" v-model="app_config.coqui.api_key"
label="Coqui API Key"></v-text-field>
</v-col>
</v-row>
</div>
<!-- RUNPOD API -->
<div v-if="applicationPageSelected === 'runpod_api'">
@@ -179,11 +207,12 @@
<v-card-text>
<v-row>
<v-col cols="4">
<v-list>
<v-list-item @click="creatorPageSelected=item.value" :prepend-icon="item.icon" v-for="(item, index) in navigation.creator" :key="index">
<v-list-item-title>{{ item.title }}</v-list-item-title>
</v-list-item>
</v-list>
<v-tabs v-model="creatorPageSelected" color="primary" direction="vertical">
<v-tab v-for="(item, index) in navigation.creator" :key="index" :value="item.value">
<v-icon class="mr-1">{{ item.icon }}</v-icon>
{{ item.title }}
</v-tab>
</v-tabs>
</v-col>
<v-col cols="8">
<div v-if="creatorPageSelected === 'content_context'">
@@ -248,8 +277,9 @@ export default {
],
application: [
{title: 'OpenAI', icon: 'mdi-api', value: 'openai_api'},
{title: 'mistral.ai', icon: 'mdi-api', value: 'mistralai_api'},
{title: 'Anthropic', icon: 'mdi-api', value: 'anthropic_api'},
{title: 'ElevenLabs', icon: 'mdi-api', value: 'elevenlabs_api'},
{title: 'Coqui Studio', icon: 'mdi-api', value: 'coqui_api'},
{title: 'RunPod', icon: 'mdi-api', value: 'runpod_api'},
],
creator: [

View File

@@ -38,14 +38,15 @@
<v-row v-for="field in clientMeta().extra_fields" :key="field.name">
<v-col cols="12">
<v-text-field v-model="client.data[field.name]" v-if="field.type==='text'" :label="field.label" :rules="[rules.required]" :hint="field.description"></v-text-field>
<v-checkbox v-else-if="field.type === 'bool'" v-model="client.data[field.name]" :label="field.label" :hint="field.description" density="compact"></v-checkbox>
</v-col>
</v-row>
<v-row>
<v-col cols="4">
<v-text-field v-model="client.max_token_length" v-if="requiresAPIUrl(client)" type="number" label="Context Length" :rules="[rules.required]"></v-text-field>
</v-col>
<v-col cols="8" v-if="!typeEditable() && client.data && client.data.prompt_template_example !== null && client.model_name && clientMeta().requires_prompt_template">
<v-combobox ref="promptTemplateComboBox" label="Prompt Template" v-model="client.data.template_file" @update:model-value="setPromptTemplate" :items="promptTemplates"></v-combobox>
<v-col cols="8" v-if="!typeEditable() && client.data && client.data.prompt_template_example !== null && client.model_name && clientMeta().requires_prompt_template && !client.data.api_handles_prompt_template">
<v-combobox ref="promptTemplateComboBox" :label="'Prompt Template for '+client.model_name" v-model="client.data.template_file" @update:model-value="setPromptTemplate" :items="promptTemplates"></v-combobox>
<v-card elevation="3" :color="(client.data.has_prompt_template ? 'primary' : 'warning')" variant="tonal">
<v-card-text>

View File

@@ -5,8 +5,8 @@
History
</v-card-title>
<v-card-text style="max-height:600px; overflow-y:scroll;">
<v-list-item v-for="(text, index) in history" :key="index" class="text-body-2">
{{ text }}
<v-list-item v-for="(entry, index) in history" :key="index" class="text-body-2">
{{ entry.ts }} {{ entry.text }}
<v-divider class="mt-1"></v-divider>
</v-list-item>
</v-card-text>