feat: add Astraflow provider support#2554
Open
ucloudnb666 wants to merge 1 commit into
Open
Conversation
Signed-off-by: ucloudnb666 <ucloudnb666@users.noreply.github.com>
Contributor
Reviewer's guide (collapsed on small PRs)Reviewer's GuideAdds Astraflow as a configurable, OpenAI-compatible provider by extending the env config types and wiring new Astraflow-related environment variables into the configuration service, along with documenting the new env vars in env.example. Flow diagram for Astraflow env vars into OpenAI-compatible chatbotflowchart TD
subgraph EnvFile
ASTRAFLOW_ENABLED
ASTRAFLOW_API_KEY
ASTRAFLOW_CN_API_KEY
end
EnvFile --> ConfigService_envProcess
ConfigService_envProcess --> AstraflowConfig[ASTRAFLOW in ConfigService]
AstraflowConfig --> OpenaiChatbot[Openai chatbot using Astraflow base URL]
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
Contributor
There was a problem hiding this comment.
Hey - I've left some high level feedback:
- Consider aligning the Astraflow config shape and naming with the existing Openai config (e.g.,
API_KEY_GLOBAL/API_KEY_CNor similar) so it’s immediately clear how each key maps to endpoints and to avoid confusion around the*_GLOBALsuffix for the China-specific key. - It may be helpful to add a brief inline comment above the
ASTRAFLOWblock inenvProcess()explaining how the Astraflow env vars are intended to be used (especially how the CN vs global keys are selected) to make the integration behavior clearer to future readers.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- Consider aligning the Astraflow config shape and naming with the existing Openai config (e.g., `API_KEY_GLOBAL` / `API_KEY_CN` or similar) so it’s immediately clear how each key maps to endpoints and to avoid confusion around the `*_GLOBAL` suffix for the China-specific key.
- It may be helpful to add a brief inline comment above the `ASTRAFLOW` block in `envProcess()` explaining how the Astraflow env vars are intended to be used (especially how the CN vs global keys are selected) to make the integration behavior clearer to future readers.Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
|
whats the purpose of include this? @ucloudnb666 |
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
Adds support for Astraflow — an OpenAI-compatible AI model aggregation platform by UCloud (优刻得) supporting 200+ models — as a configurable integration in Evolution API.
What changed
src/config/env.config.tsAstraflowtype (ENABLED,API_KEY_GLOBALfor the global endpoint,API_KEY_CN_GLOBALfor the China endpoint)ASTRAFLOW: Astraflowto theEnvinterfaceASTRAFLOW_ENABLED,ASTRAFLOW_API_KEY, andASTRAFLOW_CN_API_KEYenvironment variables inenvProcess()env.exampleASTRAFLOW_ENABLED,ASTRAFLOW_API_KEY, andASTRAFLOW_CN_API_KEYenv vars with comments pointing to the signup URLsAbout Astraflow
https://api-us-ca.umodelverse.ai/v1https://api.modelverse.cn/v1Usage
Because Astraflow is fully OpenAI-compatible, users can leverage the existing OpenAI chatbot integration in Evolution API by:
ASTRAFLOW_ENABLED=trueand supplyingASTRAFLOW_API_KEY(global) orASTRAFLOW_CN_API_KEY(China) in their.envhttps://api-us-ca.umodelverse.ai/v1https://api.modelverse.cn/v1No new SDK, no new subpackage, no database migrations required.
🔗 Related Issue
Closes #(issue_number)
🧪 Type of Change
🧪 Testing
📸 Screenshots (if applicable)
N/A
✅ Checklist
📝 Additional Notes
No new SDK, no new subpackage, and no database migrations are required. Astraflow is a fully drop-in OpenAI-compatible provider, so existing OpenAI bot integrations in Evolution API can be reused directly by pointing the base URL to the appropriate Astraflow endpoint.
Summary by Sourcery
New Features: