wenjin272 commented on PR #1382:
URL: https://github.com/apache/flink-agents/pull/1382#issuecomment-7094801671
I think we can simplify this further by putting the task-specific API
directly on the Setup, following our existing `ChatModelSetup` pattern. For
example, `ImageGenerationModelSetup` can extend `Resource` and expose
`generate()` itself, without a separate `ImageGenerationModel` interface.
The concrete integration would then look like:
```text
DashScopeImageGenerationModelSetup
extends ImageGenerationModelSetup
implements AsyncJobModel
```
It would hold the model name, default parameters, and a reference to the
shared provider/connection. `ResourceName` would point to this concrete
implementation, and Actions would retrieve and invoke it directly.
`AsyncJobModel` would remain independent. Implementations supporting cloud
jobs implement it, and callers can check and cast to it; synchronous
implementations omit it.
The integration already implements the task-specific behavior today, so this
would make that existing implementation a directly configurable Resource. We
could then remove `resolveModel()`, the private bound Resource wrappers, and
the media-specific replacement logic in `ResourceProvider`.
--
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]