From 24b40019c5313ca2189362e6c74ff6f784e4d405 Mon Sep 17 00:00:00 2001 From: vegu-ai-tools <152010387+vegu-ai-tools@users.noreply.github.com> Date: Sun, 29 Mar 2026 14:25:20 +0300 Subject: [PATCH] Add dialogue ratio configuration to chat generation - Introduced `dialogue_ratio` field in `ChatCreateGenerateArcPayload` to allow customizable dialogue percentage. - Updated `SceneToolsDirector.vue` to include a new slider for setting the dialogue ratio. - Adjusted the `openScenePlanDialog` method to initialize the dialogue ratio based on the current configuration. - Ensured the dialogue ratio is passed correctly when creating a new chat arc. --- .../agents/director/chat/websocket_handler.py | 4 ++++ .../src/components/SceneToolsDirector.vue | 17 ++++++++++++++++- 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/src/talemate/agents/director/chat/websocket_handler.py b/src/talemate/agents/director/chat/websocket_handler.py index 75fdf508..24c5580c 100644 --- a/src/talemate/agents/director/chat/websocket_handler.py +++ b/src/talemate/agents/director/chat/websocket_handler.py @@ -42,6 +42,7 @@ class ChatRemoveMessagePayload(pydantic.BaseModel): class ChatCreateGenerateArcPayload(pydantic.BaseModel): instructions: str beat_count: int = 8 + dialogue_ratio: float | None = None class ChatRegeneratePayload(pydantic.BaseModel): @@ -446,6 +447,9 @@ class DirectorChatWebsocketMixin: async def handle_chat_create_generate_arc(self, data: dict): payload = ChatCreateGenerateArcPayload(**data) + if payload.dialogue_ratio is not None: + self.director.actions["chat"].config["generate_arc_dialogue_ratio"].value = payload.dialogue_ratio + chat = self.director.chat_create_generate_arc( payload.instructions, payload.beat_count, diff --git a/talemate_frontend/src/components/SceneToolsDirector.vue b/talemate_frontend/src/components/SceneToolsDirector.vue index 73f68c01..52877347 100644 --- a/talemate_frontend/src/components/SceneToolsDirector.vue +++ b/talemate_frontend/src/components/SceneToolsDirector.vue @@ -62,10 +62,22 @@ :min="3" :max="24" :step="1" - thumb-label + thumb-label="always" color="primary" class="mt-4" > + + +