Skip to content

Conversation

fantasy-lotus
Copy link
Contributor

@fantasy-lotus fantasy-lotus commented Sep 9, 2025

fallback:
引入SpringAI 重构大模型API调用
通过SpringAI 抛出的 NonTransientAiException 进行降级逻辑,支持admin配置以及请求时配置
支持流式响应相关重构和降级

proxy apikey
支持namespace + selector级别的租户隔离代理apikey生成和管理
支持真实apikey一对多代理apikey,代理apikey仅绑定selectorid,可随时修改真实apikey

todo:

  1. global fallback config
  2. fast fail(when create client)
  3. baseurl

fantasy-lotus and others added 30 commits July 20, 2025 13:50
…/src/main/java/org/apache/shenyu/plugin/ai/proxy/enhanced/handler/AiProxyPluginHandler.java

Co-authored-by: Copilot <[email protected]>
…/src/main/java/org/apache/shenyu/plugin/ai/proxy/enhanced/service/AiProxyExecutorService.java

Co-authored-by: Copilot <[email protected]>
…/src/main/java/org/apache/shenyu/plugin/ai/proxy/enhanced/AiProxyPlugin.java

Co-authored-by: Copilot <[email protected]>
@Aias00 Aias00 added this to the 2.7.0.3 milestone Sep 23, 2025
@Aias00 Aias00 requested a review from Copilot September 23, 2025 02:46
Copy link
Contributor

@Copilot 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 an AI proxy API key mapping feature that allows administrators to create proxy API keys that map to real API keys, enabling secure API key management for AI services. The implementation includes a new enhanced AI proxy plugin with fallback support, retry mechanisms, and comprehensive data synchronization.

Key Changes:

  • New AI Proxy API Key Management: Implements a system to map proxy keys to real API keys with admin UI and CRUD operations
  • Enhanced AI Proxy Plugin: Replaces the original plugin with enhanced version supporting fallback configurations, retry logic, and proxy key authentication
  • Data Synchronization Infrastructure: Adds new ConfigGroupEnum for AI_PROXY_API_KEY with websocket and HTTP sync support

Reviewed Changes

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

Show a summary per file
File Description
shenyu-common Adds ProxyApiKeyData DTO and AI_PROXY_API_KEY config group enum
shenyu-admin Implements full CRUD operations, mappers, services for proxy API key management
shenyu-plugin-ai-proxy-enhanced New enhanced AI proxy plugin with fallback, retry, and proxy key support
shenyu-sync-data-center Extends websocket and HTTP sync to handle AI proxy API key data
shenyu-spring-boot-starter Updates configuration classes to include AI proxy API key subscribers
Database schemas Adds proxy_api_key_mapping table and related UI permissions
Comments suppressed due to low confidence (4)

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@fantasy-lotus fantasy-lotus changed the title feat: ai proxy apikey feat: AI Sep 23, 2025
@fantasy-lotus fantasy-lotus changed the title feat: AI feat: Ai Proxy enhanced with SpringAI & Fallback & Proxy apikey Sep 23, 2025
@Aias00
Copy link
Contributor

Aias00 commented Sep 23, 2025

image

Aias00
Aias00 previously approved these changes Sep 23, 2025
Copy link
Contributor

@Copilot 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

Copilot reviewed 69 out of 70 changed files in this pull request and generated 1 comment.

Comments suppressed due to low confidence (2)

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@Aias00 Aias00 merged commit 16736b3 into apache:master Sep 24, 2025
42 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.

4 participants