Skip to content

feat: add Astraflow provider support#17

Open
ucloudnb666 wants to merge 1 commit into
decodingai-magazine:mainfrom
ucloudnb666:feat/astraflow-1778824665
Open

feat: add Astraflow provider support#17
ucloudnb666 wants to merge 1 commit into
decodingai-magazine:mainfrom
ucloudnb666:feat/astraflow-1778824665

Conversation

@ucloudnb666

Copy link
Copy Markdown

Summary

Adds Astraflow (by UCloud / 优刻得) as an optional OpenAI-compatible LLM provider to both the second-brain-online and second-brain-offline apps.

Astraflow is an OpenAI-compatible AI model aggregation platform supporting 200+ models. Because it is API-compatible, the integration only requires setting base_url + api_key — no new SDK or subpackage is needed.

Changes

second-brain-online

  • config.py — adds ASTRAFLOW_API_KEY, ASTRAFLOW_CN_API_KEY, and USE_ASTRAFLOW settings
  • application/agents/agents.py — routes LiteLLMModel to the Astraflow global endpoint when USE_ASTRAFLOW=True
  • application/agents/tools/summarizer.py — routes OpenAISummarizerTool to the Astraflow global endpoint when USE_ASTRAFLOW=True
  • .env.example — documents the new env vars

second-brain-offline

  • config.py — adds ASTRAFLOW_API_KEY and ASTRAFLOW_CN_API_KEY settings
  • .env.example — documents the new env vars

Usage

Set the following in your .env file to use Astraflow:

USE_ASTRAFLOW=True
ASTRAFLOW_API_KEY=your-key-here

The agent and summarizer will then route all requests to https://api-us-ca.umodelverse.ai/v1 instead of OpenAI.

Signed-off-by: ucloudnb666 <ucloudnb666@users.noreply.github.com>
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.

1 participant