Skip to content

Implement #2459 (https://github.com/stargate/data-api/issues/2459): allow overrides for "findAndRerank" command#2460

Draft
tatu-at-datastax wants to merge 18 commits intomainfrom
tatu/2459-find-and-rerank-override
Draft

Implement #2459 (https://github.com/stargate/data-api/issues/2459): allow overrides for "findAndRerank" command#2460
tatu-at-datastax wants to merge 18 commits intomainfrom
tatu/2459-find-and-rerank-override

Conversation

@tatu-at-datastax
Copy link
Copy Markdown
Contributor

@tatu-at-datastax tatu-at-datastax commented Apr 27, 2026

What this PR does:

Adds ability to provide rerank provider/model overrides for findAndRerank; see #2459 for details.

Which issue(s) this PR fixes:
Fixes #2459

Checklist

  • Changes manually tested
  • Automated Tests added/updated
  • Documentation added/updated
  • CLA Signed: DataStax CLA

@tatu-at-datastax tatu-at-datastax self-assigned this Apr 27, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 27, 2026

Unit Test Coverage Report

Overall Project 49.88% -0.1% 🍏
Files changed 60.59% 🍏

File Coverage
RequestException.java 100% 🍏
FindAndRerankCommand.java 80% 🍏
FindAndRerankOperationBuilder.java 21.35% -12.37%

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 27, 2026

📈 Integration Test Coverage Delta vs Main Branch (dse69-it)

Metric Value
Main Branch 72.66%
This PR 72.78%
Delta 🟢 +0.12%
✅ Coverage improved!

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 27, 2026

Integration Test Coverage Report (dse69-it)

Overall Project 72.78% -0.06% 🍏
Files changed 75.46% 🍏

File Coverage
RequestException.java 100% 🍏
FindAndRerankOperationBuilder.java 85.53% -7.7% 🍏
FindAndRerankCommand.java 79.2% 🍏

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 27, 2026

Integration Test Coverage Report (hcd-it)

Overall Project 74.15% -0.06% 🍏
Files changed 75.46% 🍏

File Coverage
RequestException.java 100% 🍏
FindAndRerankOperationBuilder.java 85.53% -7.7% 🍏
FindAndRerankCommand.java 80% 🍏

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 28, 2026

📈 Integration Test Coverage Delta vs Main Branch (hcd-it)

Metric Value
Main Branch 74.05%
This PR 74.15%
Delta 🟢 +0.11%
✅ Coverage improved!

* Optional per-request override for the reranking service configuration. All fields are optional;
* unspecified fields fall back to the collection's defaults.
*/
public record RerankServiceOverride(
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

-1 can we reuse the record from CreateCollectionCommand.RerankServiceDesc

private boolean hasRerankOverride() {
var override =
getOrDefault(command.options(), FindAndRerankCommand.Options::rerankServiceOverride, null);
return override != null && (override.provider() != null || override.modelName() != null);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

there is an isEmpty() on the record, the one on the create collection command is better. we should use that.

* options with the collection's configured defaults. Result is memoized for the lifetime of this
* builder.
*/
private CollectionRerankDef.RerankServiceDef resolveEffectiveRerankServiceDef(
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

-1 - we do not want to merge the two settings, that leads to more complexity than is needed. If there is any per request setting it should override the collection settings

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Changed to not merge settings.

@tatu-at-datastax tatu-at-datastax changed the title Implement #2459: allow overrides for "findAndRerank" command Implement #2459 (https://github.com/stargate/data-api/issues/2459): allow overrides for "findAndRerank" command Apr 29, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 29, 2026

📈 Unit Test Coverage Delta vs Main Branch

Metric Value
Main Branch 49.80%
This PR 49.88%
Delta 🟢 +0.08%
✅ Coverage improved!

@tatu-at-datastax
Copy link
Copy Markdown
Contributor Author

Re-prompted:

Requirements changed -- re-plan based on issue https://github.com/stargate/data-api/issues/2459 that this PR is for
...
Review your work
...
Now, can you add one or more unit tests
...
Add one or more ITs as well
...
How about tests with auth override?

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.

Allow overriding Reranking options (provider, model, auth, parameters) on per-request basis for findAndRerank command

2 participants