Repository navigation
Conversation
foleydang
force-pushed
the
dev/agent-model-config
branch
from
October 23, 2026 10:09
31bc161 to
ff83b1b
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) and is exported from dashscope.agentstudio; agents.create/update take either a ModelConfig or a bare model id, Agent.model coerces the server object, and Agent.model_id reads the id alone. Unset parameters are omitted so the server default applies, and on update a sent config replaces the whole object -- so agent.model.copy_with(...) changes one knob without clearing the rest. copy_with also accepts a keyword the config already carries (a forward-compat field the server added), while a typo and inventing a wire field still raise. Ranges stay server-side. name is console-only: the public API neither accepts nor returns it, so the wire case no longer pins it in an assertion.
The stream wraps a single-use EventSource, so a second pass read whatever was left behind -- silently nothing on a live run, StreamClosedError once closed -- while looking like an empty turn. It now raises and says to open another stream. Delta reading itself is unchanged: chunks still come from event_delta frames. The tests cover the second pass on both the sync and the async stream.
foleydang
force-pushed
the
dev/agent-model-config
branch
from
October 23, 2026 10:28
ff83b1b to
dbf5224
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