Skip to content

Add Astraflow provider example (OpenAI-compatible)#1367

Open
ucloudnb666 wants to merge 3 commits intoAgentOps-AI:mainfrom
ucloudnb666:feat/astraflow-1778222513
Open

Add Astraflow provider example (OpenAI-compatible)#1367
ucloudnb666 wants to merge 3 commits intoAgentOps-AI:mainfrom
ucloudnb666:feat/astraflow-1778222513

Conversation

@ucloudnb666
Copy link
Copy Markdown

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 in agentops/instrumentation/__init__.py is required — this mirrors how the existing xAI / Grok integration works in this repo (examples/xai/).

Endpoints

Region Base URL Env var
Global https://api-us-ca.umodelverse.ai/v1 ASTRAFLOW_API_KEY
China https://api.modelverse.cn/v1 ASTRAFLOW_CN_API_KEY

Changes

Adds a new example directory examples/astraflow/, mirroring the existing examples/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.txtopenai, 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_KEY and ASTRAFLOW_API_KEY:

python examples/astraflow/astraflow_example.py

The example calls agentops.validate_trace_spans() at the end to confirm spans are recorded.

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