Prep 0.13.2 (#33)

* fix issue with client removal

* client type not editable after creation (keeps things simple)

* fixes issue with openai client bugging out (api_url not set)

* fix issues with edit client not reflecting changes to UX

* 0.13.2
This commit is contained in:
FInalWombat
2023-11-19 20:43:15 +02:00
committed by GitHub
parent 816f950afe
commit d250df8950
6 changed files with 17 additions and 5 deletions

View File

@@ -4,7 +4,7 @@ build-backend = "poetry.masonry.api"
[tool.poetry]
name = "talemate"
version = "0.13.1"
version = "0.13.2"
description = "AI-backed roleplay and narrative tools"
authors = ["FinalWombat"]
license = "GNU Affero General Public License v3.0"

View File

@@ -2,4 +2,4 @@ from .agents import Agent
from .client import TextGeneratorWebuiClient
from .tale_mate import *
VERSION = "0.13.1"
VERSION = "0.13.2"

View File

@@ -89,7 +89,7 @@ class Agent(ABC):
if not getattr(self.client, "enabled", True):
return False
if self.client.current_status in ["error", "warning"]:
if self.client and self.client.current_status in ["error", "warning"]:
return False
return self.client is not None

View File

@@ -47,7 +47,7 @@ class ClientBase:
def __init__(
self,
api_url: str,
api_url: str = None,
name = None,
**kwargs,
):

View File

@@ -167,12 +167,17 @@ class WebsocketHandler(Receiver):
log.info("Configuring clients", clients=clients)
for client in clients:
client.pop("status", None)
if client["type"] in ["textgenwebui", "lmstudio"]:
try:
max_token_length = int(client.get("max_token_length", 2048))
except ValueError:
continue
client.pop("model", None)
self.llm_clients[client["name"]] = {
"type": client["type"],
"api_url": client["apiUrl"],
@@ -180,6 +185,10 @@ class WebsocketHandler(Receiver):
"max_token_length": max_token_length,
}
elif client["type"] == "openai":
client.pop("model_name", None)
client.pop("apiUrl", None)
self.llm_clients[client["name"]] = {
"type": "openai",
"name": client["name"],

View File

@@ -8,7 +8,7 @@
<v-container>
<v-row>
<v-col cols="6">
<v-select v-model="client.type" :items="['openai', 'textgenwebui', 'lmstudio']" label="Client Type"></v-select>
<v-select v-model="client.type" :disabled="!typeEditable()" :items="['openai', 'textgenwebui', 'lmstudio']" label="Client Type"></v-select>
</v-col>
<v-col cols="6">
<v-text-field v-model="client.name" label="Client Name"></v-text-field>
@@ -68,6 +68,9 @@ export default {
}
},
methods: {
typeEditable() {
return this.state.formTitle === 'Add Client';
},
close() {
this.$emit('update:dialog', false);
},