From b841576eaa7f63b4da9e5e3a7b8a47c56151a8f1 Mon Sep 17 00:00:00 2001 From: Zack3D Date: Mon, 4 Aug 2025 00:20:02 -0700 Subject: [PATCH] wa --- index.js | 4 +++- src/GameStateManager.js | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/index.js b/index.js index b37af18..e9f1b0a 100644 --- a/index.js +++ b/index.js @@ -66,7 +66,7 @@ function generateRTSJSONSchema(gameState) { "description": "Current threat level" }, "lastEvent": { - "type": ["string", "null"], + "type": "string", "description": "Description of the last significant event" }, "casualties": { @@ -624,5 +624,7 @@ eventSource.on(event_types.CHAT_COMPLETION_SETTINGS_READY, (data) => { data.responseMimeType = "application/json"; data.responseSchema = RTS_JSON_SCHEMA; console.log('RTS: Using structured output with dynamic schema'); + //dump the schema to console for debugging + console.log('RTS: Current JSON schema:', JSON.stringify(RTS_JSON_SCHEMA, null, 2)); } }); \ No newline at end of file diff --git a/src/GameStateManager.js b/src/GameStateManager.js index 32b693a..4549a9a 100644 --- a/src/GameStateManager.js +++ b/src/GameStateManager.js @@ -334,7 +334,7 @@ class GameStateManager { turn: this.state.turn, currentZone: this.state.currentZone, threatLevel: this.state.threatLevel, - lastEvent: this.state.lastEvent, + ...(this.state.lastEvent && { lastEvent: this.state.lastEvent }), // Essential tracking data casualties: this.state.casualties,