Hi, i closed your PRs as you didn't reply for some months. Feel free to reopen them.
Nice that you work on this. I also had plans to use AI to improve the Petra. (Not to integrate it but to use it to see where Petra is bad at.)
Integrating it that much goes (for me) against the free software philosophy. Every code should be possible to understand.
You want the AI to choose a strategy. But you also want the AI to say when to end an attack (fall back) and how a hero should fight. Thous seem pretty different tasks. I think it's bad to solve both with the same system.
Currently there are starting-strategies witch are chosen from. It would be good when you take a look there. Maybe you can extend that.
The model you choose takes language as "state". Yes it can be json formated and yes it's multilingual but i'm not sure it understands something like
{"type":"repair","entities":[177],"target":4030,"autocontinue":true,"queued":false,"pushFront":false,"formation":"special/formations/null"}
Why? There has recently been a PR wanting to do a similar thing for Petra. As i remember it the conclusion was to not continue the plan for now.
I don't think that it is possible to do it in a mod.