Skip to content

Conversation

@CH3CHO
Copy link
Collaborator

@CH3CHO CH3CHO commented Aug 18, 2025

Ⅰ. Describe what this PR did

Do not change the configured components of Azure URL.

Ⅱ. Does this pull request fix one issue?

Ⅲ. Why don't you add test cases (unit test/integration test)?

Ⅳ. Describe how to verify it

Ⅴ. Special notes for reviews

@lingma-agents
Copy link

lingma-agents bot commented Aug 18, 2025

修复 Azure OpenAI 服务 URL 配置处理逻辑

变更概述
  • 问题修复

    • 修复了 Azure OpenAI 服务在处理不同形式的配置 URL 时的路径转换问题。
    • 引入 azureServiceUrlType 枚举类型,用于区分三种不同的服务 URL 配置模式:完整路径、仅含部署部分的路径、仅域名。
    • 根据不同的 URL 类型,调整请求路径的构造逻辑,确保不会错误地修改用户配置的 URL 组件。
    • 增加对 URL 查询参数的保留处理,确保 api-version 等参数正确传递。
  • 重构

    • 重构了 azureProvider 结构体,新增字段用于存储服务 URL 的类型、完整路径及默认模型等信息。
    • 优化了请求路径转换函数 transformRequestPath 的逻辑,使其更清晰地处理不同场景下的路径构造。
  • 测试更新

    • 虽未添加新的测试用例,但通过重构和修复增强了代码的健壮性和可维护性,为后续测试提供了更好的基础。
变更文件
文件路径 变更说明
plugins/​wasm-go/​extensions/​ai-proxy/​provider/​azure.​go 引入 azureServiceUrlType 枚举以区分不同形式的服务 URL 配置,重构路径转换逻辑以正确处理各种 URL 形式,并保留查询参数。
时序图
sequenceDiagram
    participant AP as AzureProviderInitializer
    participant AU as AzureProvider
    participant HC as HttpContext
    AP->>AU: CreateProvider(config)
    Note over AU: 解析 serviceUrl 并确定 URL 类型
    AU->>HC: transformRequestPath(apiName, originalPath)
    Note over HC: 根据 serviceUrlType 构造最终请求路径
    HC-->>AU: 返回构造后的路径
Loading

💡 小贴士

与 lingma-agents 交流的方式

📜 直接回复评论
直接回复本条评论,lingma-agents 将自动处理您的请求。例如:

  • 在当前代码中添加详细的注释说明。

  • 请详细介绍一下你说的 LRU 改造方案,并使用伪代码加以说明。

📜 在代码行处标记
在文件的特定位置创建评论并 @lingma-agents。例如:

  • @lingma-agents 分析这个方法的性能瓶颈并提供优化建议。

  • @lingma-agents 对这个方法生成优化代码。

📜 在讨论中提问
在任何讨论中 @lingma-agents 来获取帮助。例如:

  • @lingma-agents 请总结上述讨论并提出解决方案。

  • @lingma-agents 请根据讨论内容生成优化代码。

@codecov-commenter
Copy link

codecov-commenter commented Aug 18, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 45.29%. Comparing base (ef31e09) to head (b4ceb72).
⚠️ Report is 659 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #2782      +/-   ##
==========================================
+ Coverage   35.91%   45.29%   +9.38%     
==========================================
  Files          69       82      +13     
  Lines       11576    13224    +1648     
==========================================
+ Hits         4157     5990    +1833     
+ Misses       7104     6887     -217     
- Partials      315      347      +32     

see 79 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Collaborator

@johnlanni johnlanni left a comment

Choose a reason for hiding this comment

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

LGTM

@johnlanni johnlanni changed the title fix: Do not change the configured components of Azure URL fix(ai-proxy): Do not change the configured components of Azure URL Aug 18, 2025
@CH3CHO CH3CHO merged commit 0f1afcd into alibaba:main Aug 18, 2025
14 of 16 checks passed
@CH3CHO CH3CHO deleted the fix/azure-openai-req-path branch August 18, 2025 08:27
ink-hz pushed a commit to ink-hz/higress-ai-capability-auth that referenced this pull request Nov 5, 2025
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.

3 participants