Skip to content

feat(reinforcement): add trajectories to reward input - #254

Merged
luk384090-cloud merged 4 commits into
dashscope:mainfrom
luozirong2025:feat/reward-input-trajectories
Dec 2, 2026
Merged

luk384090-cloud merged 4 commits into
dashscope:mainfrom
luozirong2025:feat/reward-input-trajectories

Conversation

@luozirong2025

@luozirong2025 luozirong2025 commented Dec 2, 2026 •

Copy link
Copy Markdown
Contributor

Description

Add a Trajectory Pydantic model and an optional trajectories field to RewardInput, allowing reward requests to include conversation trajectories.

The implementation remains compatible with the declared pydantic>=2.0 dependency. Optional trajectory fields default to None, and serialization through the existing model_dump(exclude_none=True) path omits unset values.

Security Considerations: No API keys or sensitive credentials are exposed.

Type of Change

  • Bug fix
  • New feature
  • Breaking change
  • Documentation
  • Refactoring

Component(s) Affected

  • Model
  • Application
  • Common
  • Documentation
  • Tests
  • CI/CD

Checklist

  • Pre-commit hooks pass
  • Tests pass locally
  • Documentation updated (if needed)
  • Ready for review

Testing

  • python3 -m pytest tests/legacy_1x/unit/test_agentic_rl_components.py -q — 84 passed
  • python3 -m pytest tests/test_rl.py -q — 31 passed
  • Imported RewardInput with deprecation warnings treated as errors.
  • Added regression coverage for minimal trajectory parsing, optional-field defaults, None exclusion with exclude_none=True, and extra-key preservation.

@luk384090-cloud
luk384090-cloud merged commit 64207d3 into dashscope:main Dec 2, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants