Skip to content

Collection: Adding input parameter "provider"#502

Merged
nishika26 merged 2 commits intomainfrom
enhancement/provider_param_collection
Dec 18, 2025
Merged

Collection: Adding input parameter "provider"#502
nishika26 merged 2 commits intomainfrom
enhancement/provider_param_collection

Conversation

@nishika26
Copy link
Copy Markdown
Collaborator

@nishika26 nishika26 commented Dec 17, 2025

Summary

Target issue is #490

Checklist

Before submitting a pull request, please ensure that you mark these task.

  • Ran fastapi run --reload app/main.py or docker compose up in the repository root and test.

Notes

  • Just adding an input parameter, "provider" as we will be extending the collection module to be able to make knowledge base with providers other than openai

Summary by CodeRabbit

Release Notes

  • New Features
    • Collection creation now supports explicit LLM provider configuration options. Users can specify their preferred LLM service provider when creating new collections, with OpenAI currently available as the primary provider option. This enhancement enables greater control over service dependencies and ensures proper provider configuration during the collection creation and initialization process.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Dec 17, 2025

Walkthrough

A new ProviderOptions model was added to the collection module, defining an LLM provider field constrained to "openai". The CreationRequest class was updated to inherit from ProviderOptions, extending its public API. A Literal type was imported to support type constraints, and a field comment was refined.

Changes

Cohort / File(s) Summary
Collection Model Enhancements
backend/app/models/collection.py
Added Literal import from typing; created new ProviderOptions model with provider: Literal["openai"] field; extended CreationRequest to inherit from ProviderOptions; updated llm_service_name comment from "Name of the LLM service provider" to "Name of the LLM service"

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

  • New public API surface introduced via ProviderOptions model—verify naming, field defaults, and description accuracy
  • Verify CreationRequest inheritance chain maintains backward compatibility and expected behavior
  • Confirm Literal["openai"] constraint aligns with service architecture and future extensibility needs

Poem

🐰 A provider hops into view,
OpenAI constrained, tried and true!
Collections now know whom to trust,
With Literal types—it's a must!
Inheritance flows, clean and bright,
Our API takes flight! ✨

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'Collection: Adding input parameter "provider"' directly and clearly describes the main change - adding a new 'provider' parameter to the collection module.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch enhancement/provider_param_collection

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@nishika26 nishika26 marked this pull request as ready for review December 17, 2025 09:42
@codecov
Copy link
Copy Markdown

codecov bot commented Dec 17, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@nishika26 nishika26 self-assigned this Dec 17, 2025
@nishika26 nishika26 linked an issue Dec 17, 2025 that may be closed by this pull request
@nishika26 nishika26 added enhancement New feature or request ready-for-review labels Dec 17, 2025
Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3

📜 Review details

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between d26401b and 0c3f4be.

📒 Files selected for processing (1)
  • backend/app/models/collection.py (3 hunks)
🧰 Additional context used
📓 Path-based instructions (2)
**/*.py

📄 CodeRabbit inference engine (CLAUDE.md)

Use type hints in Python code (Python 3.11+ project)

Files:

  • backend/app/models/collection.py
backend/app/models/**/*.py

📄 CodeRabbit inference engine (CLAUDE.md)

Define SQLModel entities (database tables and domain objects) in backend/app/models/

Files:

  • backend/app/models/collection.py
🧬 Code graph analysis (1)
backend/app/models/collection.py (2)
backend/app/tests/services/llm/providers/test_openai.py (1)
  • provider (27-29)
backend/app/crud/rag/open_ai.py (1)
  • default (31-32)
🔇 Additional comments (1)
backend/app/models/collection.py (1)

2-2: LGTM!

The Literal import is correctly added to support the type constraint in the new ProviderOptions class.

@nishika26 nishika26 merged commit 579c38b into main Dec 18, 2025
3 checks passed
@nishika26 nishika26 deleted the enhancement/provider_param_collection branch December 18, 2025 11:52
Prajna1999 added a commit that referenced this pull request Jan 12, 2026
* Enhancing swagger and redocs (#484)

* rearranging endpoints for swagger and redocs

* Claude: Next steps (#500)

* claude updates

* updated migration command

* making it concise

* add step to add typehint

* Add Langfuse observability to Unified API (#457)

* Add Langfuse observability to LLM execution methods

* Enhance observability decorator to validate Langfuse credentials before execution

* remove trace metadata

* precommit

* remove creds check

* Unified API: Add support for Kaapi Abstracted LLM Call (#498)

* Add Kaapi LLM parameters and completion config; implement transformation to native provider format

* Refine LLM API documentation and improve code formatting for clarity; enhance configuration handling for OpenAI provider

* add/fix tests

* Fix validation logic in map_kaapi_to_openai_params to prevent simultaneous setting of 'temperature' and 'reasoning' parameters

* Remove default value for 'model' in KaapiLLMParams to enforce explicit assignment

* Refactor KaapiLLMParams to enforce explicit reasoning levels; update mapping logic to handle reasoning and temperature conflicts with warnings

* Enhance LLM API documentation to clarify ad-hoc configuration parameters and warning handling for unsupported settings

* Refactor execute_job to use completion_config directly instead of config_blob.completion

* Refactor LLM provider interfaces to use NativeCompletionConfig instead of CompletionConfig

* precommit

* Evaluation: Uploading dataset concurrently (#461)

* fix: add threadpool based concurrency to speeden up langfuse dataset upload

* chore: fix precommit linting issues

* fix: cleanup and deleted CELERY.md

* chore: formatting

---------

Co-authored-by: Akhilesh Negi <akhileshnegi.an3@gmail.com>

* adding provider input (#502)

* Documentation : repo enhancement (#496)

* Documentation : repo MDs enhancement and adding enhancement template

* Kaapi v1.0: Permissions Review and Authorization Cleanup (#501)

* Refactor dependencies and enhance AuthContext for non-optional organization and project attributes

* Refactor permission checks to require SUPERUSER role across multiple routes

* fix session

* Refactor routes to enhance AuthContext usage and enforce project permissions

* Refactor dependency imports and remove unused parameters across multiple files

* Refactor user model by removing UserOrganization and UserProjectOrg classes; update tests to use AuthContext for user-related operations

* precommit

* require project in llm call

* fix: update project attribute reference in CRUD operations

---------

Co-authored-by: Nishika Yadav <89646695+nishika26@users.noreply.github.com>

* refactor: remove API key encryption and decryption functions from security module and tests (#507)

API Key: remove API key encryption and decryption functions

* added depends as import

---------

Co-authored-by: Nishika Yadav <89646695+nishika26@users.noreply.github.com>
Co-authored-by: Akhilesh Negi <akhileshnegi.an3@gmail.com>
Co-authored-by: Aviraj Gour <100823015+avirajsingh7@users.noreply.github.com>
@coderabbitai coderabbitai bot mentioned this pull request Feb 24, 2026
2 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request ready-for-review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Collection: take provider as input parameter

3 participants