feat(openai): add per-capability default model config via Builder#1925
Open
Buktal wants to merge 3 commits into
Open
feat(openai): add per-capability default model config via Builder#1925Buktal wants to merge 3 commits into
Buktal wants to merge 3 commits into
Conversation
Replace the single defaultModelName field with per-capability defaults (defaultVisionModel, defaultImageGenModel, defaultTtsModel, defaultSttModel) via a new Builder, matching OpenAIChatModel.Builder conventions. Existing constructors remain for backward compatibility. Default values unchanged: gpt-4o, dall-e-3, tts-1, whisper-1. Closes agentscope-ai#1924
When the outer timeout cancels the subscription, boundedElastic interrupts the sleeping thread via Future.cancel(true). The old code wrapped both the sleep and the file write in one try-catch, so the interrupt silently skipped the write. Split them so the write always executes even if sleep is interrupted. Closes agentscope-ai#1924 (part of PR agentscope-ai#1925)
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
Contributor
|
Nice work on the Builder — backward compat is well handled with the old constructor delegating to the new private one. One thing I noticed: the builder tests only do |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
AgentScope-Java Version
2.0.0-SNAPSHOT
Description
1. Per-capability default model via Builder
OpenAIMultiModalToolpreviously had a singledefaultModelNamefield that only applied toopenai_image_to_text. The other three tools had their default models hardcoded.This adds a
BuildermatchingOpenAIChatModel.Builderconventions, exposing per-capability defaults:defaultVisionModel— image-to-text (falls back togpt-4o)defaultImageGenModel— text-to-image (falls back todall-e-3)defaultTtsModel— text-to-audio (falls back totts-1)defaultSttModel— audio-to-text (falls back towhisper-1)baseUrl— custom endpoint (optional)When not set via Builder, the existing hardcoded values are used — no change to current behavior.
2. Flaky test fix
SubAgentToolTimeoutRetryIntegrationTest.oldAgentIsStoppedwas flaky: when the timeout cancelled the subscription,boundedElasticinterrupted the sleeping thread viaFuture.cancel(true). The old code wrapped bothThread.sleepandFiles.writeStringin one try-catch, so the interrupt silently skipped the write, making the assertion fail. Fixed by splitting them.Related:
Checklist
mvn spotless:applymvn test)