Add Astraflow provider example (OpenAI-compatible)#1367
Open
ucloudnb666 wants to merge 3 commits intoAgentOps-AI:mainfrom
Open
Add Astraflow provider example (OpenAI-compatible)#1367ucloudnb666 wants to merge 3 commits intoAgentOps-AI:mainfrom
ucloudnb666 wants to merge 3 commits intoAgentOps-AI:mainfrom
Conversation
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.
Summary
Adds support for Astraflow (UCloud / 优刻得 umodelverse), an OpenAI-compatible AI model aggregation platform supporting 200+ models.
Because Astraflow is OpenAI-compatible, AgentOps' existing OpenAI instrumentation automatically tracks every Astraflow call when the OpenAI client is pointed at the Astraflow
base_url. No new instrumentor or registration inagentops/instrumentation/__init__.pyis required — this mirrors how the existing xAI / Grok integration works in this repo (examples/xai/).Endpoints
https://api-us-ca.umodelverse.ai/v1ASTRAFLOW_API_KEYhttps://api.modelverse.cn/v1ASTRAFLOW_CN_API_KEYChanges
Adds a new example directory
examples/astraflow/, mirroring the existingexamples/xai/pattern exactly:examples/astraflow/astraflow_example.py— minimal chat completion example via the OpenAI client + AgentOps tracing, auto-selects global vs. China endpoint based on which env var is set.examples/astraflow/requirements.txt—openai,agentops,python-dotenv.examples/astraflow/README.md— usage instructions.No changes to the SDK itself — minimum viable integration.
Testing
Run the example after exporting
AGENTOPS_API_KEYandASTRAFLOW_API_KEY:The example calls
agentops.validate_trace_spans()at the end to confirm spans are recorded.