diff --git a/modules/rpgmakermvmz.py b/modules/rpgmakermvmz.py index e327112..59aaa9c 100644 --- a/modules/rpgmakermvmz.py +++ b/modules/rpgmakermvmz.py @@ -193,7 +193,7 @@ HEADER_MAPPINGS_357 = { "TemplateEvent": (["eventId"], None), } # Subset of HEADER_MAPPINGS_357 keys that should be processed (empty = none). -ENABLED_PLUGINS_357: set = {"EventLabel", "KN_MapBattle", "KN_Shop", "Mano_CurrencyUnit", "SceneGlossary", "TorigoyaMZ_NotifyMessage", "TorigoyaMZ_NotifyMessage_CommandMessage"} +ENABLED_PLUGINS_357: set = set() # All known code-355/655 script patterns. Enable entries via ENABLED_PATTERNS_355655. PATTERNS_355655 = { diff --git a/util/translation.py b/util/translation.py index fe862e8..534df6d 100644 --- a/util/translation.py +++ b/util/translation.py @@ -915,13 +915,23 @@ def translateText(system, user, history, penalty, formatType, model, numLines=No ant_client = anthropic.Anthropic(api_key=openai.api_key) try: - ant_resp = ant_client.messages.create( + ant_kwargs = dict( model=model, max_tokens=16384, temperature=0, system=ant_system, messages=native_msgs, ) + # Use native structured output (output_config) when a JSON schema is required. + # Supported on claude-opus-4-6, claude-sonnet-4-6/4-5, claude-haiku-4-5. + if formatType == "json" and numLines is not None: + ant_kwargs["output_config"] = { + "format": { + "type": "json_schema", + "schema": createTranslationSchema(numLines), + } + } + ant_resp = ant_client.messages.create(**ant_kwargs) except Exception as e: raise Exception(f"Anthropic API error: {e}")