Repository navigation
Fix: ollama provider - #16519
Fix: ollama provider#16519
Conversation
📝 WalkthroughWalkthroughThe provider instance creation endpoint now requires only ChangesProvider Instance Validation and Config Update
Estimated code review effort: 1 (Trivial) | ~5 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
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 |
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
api/apps/restful_apis/provider_api.py (1)
314-340: 🗄️ Data Integrity & Integration | 🟡 Minor | ⚡ Quick winUpdate Swagger schema to match relaxed validation.
The
requiredarray in the docstring schema (Lines 316-318) still listsapi_keyas required, but the code now only enforcesinstance_name(Line 339). This will mislead API consumers or schema-generation tooling into believingapi_keyis mandatory.📝 Proposed fix
schema: type: object required: - instance_name - - api_key properties:🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@api/apps/restful_apis/provider_api.py` around lines 314 - 340, The Swagger docstring schema in provider_api.py still marks api_key as required even though create-instance validation only checks instance_name in the request handler. Update the schema under the create endpoint’s docstring so the required list matches the relaxed validation, keeping api_key optional while leaving the rest of the properties unchanged.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Outside diff comments:
In `@api/apps/restful_apis/provider_api.py`:
- Around line 314-340: The Swagger docstring schema in provider_api.py still
marks api_key as required even though create-instance validation only checks
instance_name in the request handler. Update the schema under the create
endpoint’s docstring so the required list matches the relaxed validation,
keeping api_key optional while leaving the rest of the properties unchanged.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 19b05a54-ae26-4a53-b212-3eb73f0acd2b
📒 Files selected for processing (2)
api/apps/restful_apis/provider_api.pyconf/llm_factories.json
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #16519 +/- ##
==========================================
- Coverage 94.56% 93.16% -1.40%
==========================================
Files 10 10
Lines 717 717
Branches 118 118
==========================================
- Hits 678 668 -10
- Misses 25 29 +4
- Partials 14 20 +6 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Summary
Ollama: remove default model, allow empty api_key for non‑VLLM.
Close #16508