Repository navigation
Conversation
foleydang
force-pushed
the
dev/agent-model-config
branch
3 times, most recently
from
October 23, 2026 08:44
aa2932c to
73a2d04
Compare
The agent `model` field is a config object, not only a model id. ModelConfig
gains the four optional inference parameters of the Managed Agent API
(temperature, max_tokens, enable_thinking, thinking_budget) plus builder(),
toBuilder() and of(id); the param classes send that object as-is instead of
rebuilding {"id": ...}.
Shaped after the Claude Managed Agents client, where beta.agents
AgentCreateParams exposes model(...) overloads for a bare model id and for a
ModelConfigParams object:
- the field is modelConfig, so the whole config has a matching accessor pair;
String getModel() still returns the id (base-class contract unchanged)
- model(String) / model(ModelConfig) builder aliases, setModel(String) as an
alias of setModelConfig; unset parameters are omitted so the server default
applies, and an update replaces the config as a whole
- create validates model.id the way update already does, instead of only failing
server-side after the request has left
- name is console-only: the public API neither accepts nor returns it, so the
read-back case asserts it is absent
- samples/AgentStudioSimple.java points at the object form, which was otherwise
only discoverable from javadoc
Public surface is additive: javap against the released 2.23.2 shows no removed
or re-typed member.
…m single-pass `delta` was typed as a JsonObject, so a frame carrying anything else made Gson throw while parsing it; the stream queued that exception and re-raised it as an ApiException, dropping every event after it. It is held as a JsonElement and read as a payload object when it is one, so such a frame is simply not a chunk instead of an aborted stream. getEventDelta() still returns a JsonObject. A second pass over one stream could never work either: the queue drains into a single reader, so the next iterator blocked for the whole timeout and then reported stream_timeout. iterator() now fails fast, the way the Python SDK's second pass raises.
foleydang
force-pushed
the
dev/agent-model-config
branch
from
October 23, 2026 10:25
7050cc2 to
7725e78
Compare
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.
Description
The agent
modelfield is a config object, not only a model id. ModelConfig gains the four optional inference parameters of the Managed Agent API reference (temperature, max_tokens, enable_thinking, thinking_budget) and is exported from dashscope.agentstudio. agents.create/update accept either a ModelConfig or a bare model id (the ModelConfig(id=...) shorthand), and Agent.model coerces the server object, with Agent.model_id for the id alone.Related Issue: Fixes #[issue_number] or Relates to #[issue_number]
Security Considerations: [Check if API keys or sensitive credentials are exposed in code/logs]
Type of Change
Component(s) Affected
Checklist
Testing
[How to test these changes]
Pass
Additional Notes
[Optional: any other context]
None