Skip to content

Conversation

@OhYee
Copy link
Member

@OhYee OhYee commented Dec 18, 2025

…policy configurations

enhance proxy configuration with structured models for token rate limiting and AI guardrails, transition policy definitions from dictionary to typed objects, and extend model proxy props with execution role support; upgrade alibabacloud-agentrun dependency for improved capabilities

为代理配置引入结构化的令牌速率限制和 AI 防护模型,将策略定义从字典类型转为强类型对象,
并在模型代理属性中新增执行角色支持;升级 alibabacloud-agentrun 依赖以提升功能能力

Change-Id: Id35290e04cfb9c4f3f73933febe0d80ff65651a8

Thank you for creating a pull request to contribute to Serverless Devs agentrun-sdk-python code! Before you open the request please answer the following questions to help it be more easily integrated. Please check the boxes "[ ]" with "[x]" when done too.
Please select one of the PR types below to complete


Fix bugs

Bug detail

The specific manifestation of the bug or the associated issue.

Pull request tasks

  • Add test cases for the changes
  • Passed the CI test

Update docs

Reason for update

Why do you need to update your documentation?

Pull request tasks

  • Update Chinese documentation
  • Update English documentation

Add contributor

Contributed content

  • Code
  • Document

Content detail

if content_type == 'code' || content_type == 'document':
    please tell us `PR url`,like: https://github.com/Serverless-Devs/agentrun-sdk-python/pull/1
else:
    please describe your contribution in detail

Others

Reason for update

Why do you need to update your documentation?

…policy configurations

enhance proxy configuration with structured models for token rate limiting and AI guardrails,
transition policy definitions from dictionary to typed objects, and extend model proxy props
with execution role support; upgrade alibabacloud-agentrun dependency for improved capabilities

为代理配置引入结构化的令牌速率限制和 AI 防护模型,将策略定义从字典类型转为强类型对象,
并在模型代理属性中新增执行角色支持;升级 alibabacloud-agentrun 依赖以提升功能能力

Change-Id: Id35290e04cfb9c4f3f73933febe0d80ff65651a8
Signed-off-by: OhYee <oyohyee@oyohyee.com>
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR introduces structured configuration models for rate limiting and AI guardrails in the model proxy system, transitioning from dictionary-based to strongly-typed policy configurations. The changes enhance type safety and API clarity while extending the model proxy with execution role support.

Key Changes:

  • Added two new configuration models: ProxyConfigTokenRateLimiter (for token-based rate limiting with tps/tpm/tph/tpd options) and ProxyConfigAIGuardrailConfig (for AI guardrail settings)
  • Changed ProxyConfigPolicies.fallbacks from single object to list and transitioned ProxyConfig.policies from Dict[str, Any] to strongly-typed ProxyConfigPolicies
  • Extended ModelProxyMutableProps with execution_role_arn field for AWS role-based access control

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

File Description
pyproject.toml Upgrades alibabacloud-agentrun20250910 dependency from 4.0.1 to 4.0.3 for enhanced capabilities
agentrun/model/model.py Introduces ProxyConfigTokenRateLimiter and ProxyConfigAIGuardrailConfig models, refactors ProxyConfigPolicies to use typed objects, adds execution_role_arn field, and changes fallbacks to list type

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

OhYee and others added 2 commits December 18, 2025 19:20
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Signed-off-by: OhYee <oyohyee@oyohyee.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Signed-off-by: OhYee <oyohyee@oyohyee.com>
@OhYee OhYee merged commit 9b47c50 into main Dec 18, 2025
1 check passed
@OhYee OhYee deleted the update-agentrun-model branch December 18, 2025 11:21
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