mirror of
https://gitee.com/dromara/liteFlow.git
synced 2026-06-10 03:07:32 +08:00
fix(react-agent-core): widen ModelSpec.resolve to public
resolve() is the framework SPI: ReActAgentComponent (in a different package) needs to call spec.resolve(cfg), which protected access does not permit. The test's TestSpec override is widened in lockstep since Java forbids narrowing visibility on override. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
@@ -48,6 +48,9 @@ public abstract class ModelSpec<SELF extends ModelSpec<SELF>> {
|
||||
* 把本描述符解析为 agentscope {@link Model} 实例。
|
||||
* 实现需从 {@link AgentConfig} 中读取对应平台的 credential,
|
||||
* 并把共性 + 个性参数翻译成 agentscope 的 GenerateOptions。
|
||||
* <p>
|
||||
* 本方法是框架 SPI:{@code ReActAgentComponent} 在不同包中调用,
|
||||
* 因此必须为 {@code public}。
|
||||
*/
|
||||
protected abstract Model resolve(AgentConfig cfg);
|
||||
public abstract Model resolve(AgentConfig cfg);
|
||||
}
|
||||
|
||||
@@ -10,7 +10,7 @@ class ModelSpecTest {
|
||||
|
||||
/** 仅用于测试的最小 ModelSpec 子类。 */
|
||||
static class TestSpec extends ModelSpec<TestSpec> {
|
||||
@Override protected Model resolve(AgentConfig cfg) { return null; }
|
||||
@Override public Model resolve(AgentConfig cfg) { return null; }
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
Reference in New Issue
Block a user