diff --git a/pyproject.toml b/pyproject.toml index fb687fc0..84b3da25 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -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" diff --git a/src/talemate/__init__.py b/src/talemate/__init__.py index 560f7619..dc4e897d 100644 --- a/src/talemate/__init__.py +++ b/src/talemate/__init__.py @@ -2,4 +2,4 @@ from .agents import Agent from .client import TextGeneratorWebuiClient from .tale_mate import * -VERSION = "0.18.0" +VERSION = "0.18.1" diff --git a/src/talemate/client/base.py b/src/talemate/client/base.py index b78c7eeb..a30e9f2f 100644 --- a/src/talemate/client/base.py +++ b/src/talemate/client/base.py @@ -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: diff --git a/src/talemate/client/lmstudio.py b/src/talemate/client/lmstudio.py index 455d77d7..0282d349 100644 --- a/src/talemate/client/lmstudio.py +++ b/src/talemate/client/lmstudio.py @@ -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" diff --git a/src/talemate/config.py b/src/talemate/config.py index a81408d5..f6259f1e 100644 --- a/src/talemate/config.py +++ b/src/talemate/config.py @@ -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" diff --git a/talemate_frontend/src/components/ClientModal.vue b/talemate_frontend/src/components/ClientModal.vue index 37fe5286..b0c240a1 100644 --- a/talemate_frontend/src/components/ClientModal.vue +++ b/talemate_frontend/src/components/ClientModal.vue @@ -6,13 +6,14 @@ {{ title() }} + - + @@ -24,7 +25,7 @@ - + @@ -36,7 +37,7 @@ - + @@ -54,11 +55,12 @@ + Cancel - Save + Save @@ -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: {