mirror of
https://github.com/vegu-ai/talemate.git
synced 2025-12-16 11:47:48 +01:00
Prep 0.18.1 (#72)
* prevent client ctx from being unset * fix issue with LMStudio client ctx size not sticking * 0.18.1
This commit is contained in:
@@ -4,7 +4,7 @@ build-backend = "poetry.masonry.api"
|
||||
|
||||
[tool.poetry]
|
||||
name = "talemate"
|
||||
version = "0.18.0"
|
||||
version = "0.18.1"
|
||||
description = "AI-backed roleplay and narrative tools"
|
||||
authors = ["FinalWombat"]
|
||||
license = "GNU Affero General Public License v3.0"
|
||||
|
||||
@@ -2,4 +2,4 @@ from .agents import Agent
|
||||
from .client import TextGeneratorWebuiClient
|
||||
from .tale_mate import *
|
||||
|
||||
VERSION = "0.18.0"
|
||||
VERSION = "0.18.1"
|
||||
|
||||
@@ -118,7 +118,7 @@ class ClientBase:
|
||||
if "api_url" in kwargs:
|
||||
self.api_url = kwargs["api_url"]
|
||||
|
||||
if "max_token_length" in kwargs:
|
||||
if kwargs.get("max_token_length"):
|
||||
self.max_token_length = kwargs["max_token_length"]
|
||||
|
||||
if "enabled" in kwargs:
|
||||
|
||||
@@ -7,12 +7,11 @@ from talemate.client.registry import register
|
||||
|
||||
class Defaults(pydantic.BaseModel):
|
||||
api_url: str = "http://localhost:1234"
|
||||
|
||||
max_token_length: int = 4096
|
||||
|
||||
@register()
|
||||
class LMStudioClient(ClientBase):
|
||||
client_type = "lmstudio"
|
||||
conversation_retries = 5
|
||||
|
||||
class Meta(ClientBase.Meta):
|
||||
name_prefix: str = "LMStudio"
|
||||
|
||||
@@ -22,7 +22,7 @@ class Client(BaseModel):
|
||||
model: Union[str, None] = None
|
||||
api_url: Union[str, None] = None
|
||||
api_key: Union[str, None] = None
|
||||
max_token_length: Union[int, None] = None
|
||||
max_token_length: int = 4096
|
||||
|
||||
class Config:
|
||||
extra = "ignore"
|
||||
|
||||
@@ -6,13 +6,14 @@
|
||||
<span class="headline">{{ title() }}</span>
|
||||
</v-card-title>
|
||||
<v-card-text>
|
||||
<v-form ref="form" v-model="formIsValid">
|
||||
<v-container>
|
||||
<v-row>
|
||||
<v-col cols="6">
|
||||
<v-select v-model="client.type" :disabled="!typeEditable()" :items="clientChoices" label="Client Type" @update:model-value="resetToDefaults"></v-select>
|
||||
</v-col>
|
||||
<v-col cols="6">
|
||||
<v-text-field v-model="client.name" label="Client Name"></v-text-field>
|
||||
<v-text-field v-model="client.name" label="Client Name" :rules="[rules.required]"></v-text-field>
|
||||
</v-col>
|
||||
</v-row>
|
||||
<v-row v-if="clientMeta().experimental">
|
||||
@@ -24,7 +25,7 @@
|
||||
<v-col cols="12">
|
||||
<v-row>
|
||||
<v-col :cols="clientMeta().enable_api_auth ? 7 : 12">
|
||||
<v-text-field v-model="client.api_url" v-if="requiresAPIUrl(client)" label="API URL"></v-text-field>
|
||||
<v-text-field v-model="client.api_url" v-if="requiresAPIUrl(client)" :rules="[rules.required]" label="API URL"></v-text-field>
|
||||
</v-col>
|
||||
<v-col cols="5">
|
||||
<v-text-field type="password" v-model="client.api_key" v-if="requiresAPIUrl(client) && clientMeta().enable_api_auth" label="API Key"></v-text-field>
|
||||
@@ -36,7 +37,7 @@
|
||||
</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"></v-text-field>
|
||||
<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>
|
||||
@@ -54,11 +55,12 @@
|
||||
</v-col>
|
||||
</v-row>
|
||||
</v-container>
|
||||
</v-form>
|
||||
</v-card-text>
|
||||
<v-card-actions>
|
||||
<v-spacer></v-spacer>
|
||||
<v-btn color="primary" text @click="close" prepend-icon="mdi-cancel">Cancel</v-btn>
|
||||
<v-btn color="primary" text @click="save" prepend-icon="mdi-check-circle-outline">Save</v-btn>
|
||||
<v-btn color="primary" text @click="save" prepend-icon="mdi-check-circle-outline" :disabled="!formIsValid">Save</v-btn>
|
||||
</v-card-actions>
|
||||
</v-card>
|
||||
</v-dialog>
|
||||
@@ -77,12 +79,19 @@ export default {
|
||||
],
|
||||
data() {
|
||||
return {
|
||||
formIsValid: false,
|
||||
promptTemplates: [],
|
||||
clientTypes: [],
|
||||
clientChoices: [],
|
||||
localDialog: this.state.dialog,
|
||||
client: { ...this.state.currentClient },
|
||||
defaultValuesByCLientType: {}
|
||||
defaultValuesByCLientType: {},
|
||||
rules: {
|
||||
required: value => !!value || 'Field is required.',
|
||||
},
|
||||
rulesMaxTokenLength: [
|
||||
v => !!v || 'Context length is required',
|
||||
],
|
||||
};
|
||||
},
|
||||
watch: {
|
||||
|
||||
Reference in New Issue
Block a user