sangkyoonnam commented on issue #1333: URL: https://github.com/apache/flink-agents/issues/1333#issuecomment-6493250561
I'll implement this natively in the Python chat model action, with router descriptors that use the same keys and strategy tags as Java. `RemoteExecutionEnvironment.apply` already sends the Python plan JSON to Java for validation, so `AgentPlan.validateRoutingStrategies` would check Python-declared routers too. I'll split this into three PRs, with the LLM judge last as in the Java work. First, the Python `chat()` gets split into per-model attempts, since fallback needs a unit that retries one candidate without sending the final failure event. That PR shouldn't change behavior. Then routers with the rule-based and custom strategies, fallback, the `route:<router>` and `chat:<router>:<candidate>` durable IDs, `ModelRoutingEvent` and the latency histogram. Then the LLM judge. Until a follow-up adds it, Python would reject the decision-model strategy from #1330 at plan time. One Java change comes with the second PR. `validateCustomExecutor` calls `Class.forName` on the executor class, so a Python custom strategy fails Java validation. I'll skip that check when the router comes from a `PythonResourceProvider` and validate the class on the Python side instead. Rule patterns will also have to compile in both Python and Java, since Java validates them too; I'll document that restriction and add tests for the known matching differences. Let me know if you'd rather have this in one PR or handle the custom check another way. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
