Repository navigation
feat(go-models): add PPIO provider driver - #15099
Conversation
Add a PPIO Go model driver, provider catalog, factory registration, and focused coverage for chat, streaming, model listing, connection checks, custom base URLs, and provider config loading. Repair existing model-package validation blockers so the scoped Go model/provider tests can run with vet enabled.
📝 WalkthroughWalkthroughAdds a PPIO provider: config file, factory wiring, PPIOModel driver (chat non-stream/stream, ListModels, CheckConnection), comprehensive tests, and standardizes "no such method" / HTTP error messages across several existing drivers and tests. ChangesPPIO Provider Implementation and Error Standardization
Sequence Diagram(s)sequenceDiagram
participant Client
participant PPIOModel
participant PPIOEndpoint
Client->>PPIOModel: ChatWithMessages / ChatStreamlyWithSender
PPIOModel->>PPIOModel: validate API key, model, messages
PPIOModel->>PPIOModel: build endpoint URL (region-aware)
PPIOModel->>PPIOEndpoint: POST /chat/completions (Bearer auth)
alt Non-streaming
PPIOEndpoint-->>PPIOModel: JSON response (choices, reasoning_content)
PPIOModel-->>Client: ChatResponse (Answer, ReasonContent)
else Streaming
PPIOEndpoint-->>PPIOModel: SSE stream (data: events)
PPIOModel->>PPIOModel: parse delta events (reasoning/content)
PPIOModel-->>Client: incremental sender callbacks
PPIOModel->>PPIOModel: detect [DONE] / finish reason
end
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related issues
Possibly related PRs
Suggested labels
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
This one is done as well, @JinHai-CN - in case you're around to review/merge. Thanks a bunch in advance! 🙌🏻 |
Haruko386
left a comment
There was a problem hiding this comment.
Hi @JSONbored, I get some wired problem: two url is right
I suggest my adivce.
All other tests are passed, thank you for your contribution.
Switch the default PPIO endpoint to the api.ppio.com v1 path, retain the ppinfra endpoint as us, and add DeepSeek v4 flash/pro catalog coverage with tests.
Thanks, addressed both review requests:
Validation:
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #15099 +/- ##
=======================================
Coverage 93.12% 93.12%
=======================================
Files 10 10
Lines 713 713
Branches 116 116
=======================================
Hits 664 664
Misses 29 29
Partials 20 20 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
What problem does this PR solve?
Closes #15089.
Adds PPIO support to the Go model-provider layer so PPIO instances can be routed through the Go API server with the same OpenAI-compatible chat, streaming, model listing, and connection-check flow used by other SaaS providers.
Type of change
Summary
What changed
Why
The existing Python/provider catalog path includes PPIO, but the Go model-provider layer did not have a PPIO driver, so the Go API server could not instantiate or use PPIO as requested in #15089.
Validation
go test ./internal/entity/models -run PPIO -count=1go test ./internal/entity/models -count=1go test ./internal/entity/... -count=1jq empty conf/models/ppio.jsongit diff --checkAlso attempted
go test ./internal/... -count=1; it is currently blocked locally by pre-existing non-provider issues: missing native tokenizer artifacts/libraries, an existing service-layer vet issue, an Infinity API test mismatch, and MinIO-backed storage tests requiring local MinIO.Notes
The default PPIO base URL follows the existing RAGFlow Python provider default and can still be overridden by user configuration.