Skip to content

docs(api): describe supported search rankers - #6395

Merged
mattf merged 3 commits into
ogx-ai:mainfrom
KXHXK:docs/ranker-schema-description
Aug 15, 2026
Merged

docs(api): describe supported search rankers#6395
mattf merged 3 commits into
ogx-ai:mainfrom
KXHXK:docs/ranker-schema-description

Conversation

@KXHXK

@KXHXK KXHXK commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

What does this PR do?

Adds a schema description to SearchRankingOptions.ranker that lists the currently supported ranking algorithms: weighted, rrf, neural, and classifier.

The field remains str | None, so this is documentation-only and preserves acceptance of other strings for OpenAI API compatibility. A regression test verifies the generated Pydantic schema, and the checked-in OpenAPI specifications are regenerated.

Closes #6176

Test Plan

uv run ruff format --check src/ogx_api/vector_io/models.py tests/unit/providers/responses/builtin/test_openai_responses_file_search_ranking_options.py
uv run ruff check src/ogx_api/vector_io/models.py tests/unit/providers/responses/builtin/test_openai_responses_file_search_ranking_options.py
uv run pytest -q tests/unit/providers/responses/builtin/test_openai_responses_file_search_ranking_options.py
PYTHONUTF8=1 uv run ./scripts/run_openapi_generator.sh

Output:

2 files already formatted
All checks passed!
2 passed in 0.05s

Stable schema is valid
Experimental schema is valid
Deprecated schema is valid
Combined (stainless) schema is valid
OpenAPI specification generated successfully!
Schemas: 430
Paths: 50
Operations: 70

{
  "anyOf": [{"type": "string"}, {"type": "null"}],
  "default": null,
  "description": "Name of the ranking algorithm. Supported values are weighted, rrf, neural, and classifier. Other string values are accepted for OpenAI API compatibility but are not supported.",
  "title": "Ranker"
}

I also attempted the full pre-commit run twice; initialization could not fetch pre-commit-hooks because the GitHub connection timed out/reset. The relevant Ruff, pytest, schema validation, and generated-file checks above completed locally.

Signed-off-by: KXH <shepherdlaurie238@gmail.com>

@mattf mattf left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

update the test to check that the description is present or things like "weighted" "rff" are in it

KXHXK added 2 commits August 15, 2026 01:47
Signed-off-by: KXH <shepherdlaurie238@gmail.com>
Signed-off-by: KXH <shepherdlaurie238@gmail.com>
@KXHXK

KXHXK commented Aug 14, 2026

Copy link
Copy Markdown
Contributor Author

Thanks - updated the test as suggested. It now verifies that the schema description is present and independently checks for weighted, rrf, neural, and classifier, instead of coupling the test to the complete wording.

Verification on the updated test file:

  • uv run pytest tests/unit/providers/responses/builtin/test_openai_responses_file_search_ranking_options.py -q - 2 passed
  • uv run ruff check ... - passed
  • uv run ruff format --check ... - passed

Current head: 89677f9.

@mattf
mattf enabled auto-merge August 15, 2026 15:37
@mattf
mattf added this pull request to the merge queue Aug 15, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to no response for status checks Aug 15, 2026
@mattf
mattf added this pull request to the merge queue Aug 15, 2026
Merged via the queue into ogx-ai:main with commit 59872d4 Aug 15, 2026
38 checks passed
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.

Improve the documented API schema

2 participants