Commit 2830b82
authored
docs(api): describe supported search rankers (#6395)
# 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
```bash
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:
```text
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>1 parent 1b7234d commit 2830b82
7 files changed
Lines changed: 22 additions & 1 deletion
File tree
- client-sdks/stainless
- docs/static
- src/ogx_api/vector_io
- tests/unit/providers/responses/builtin
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13928 | 13928 | | |
13929 | 13929 | | |
13930 | 13930 | | |
| 13931 | + | |
13931 | 13932 | | |
13932 | 13933 | | |
13933 | 13934 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7572 | 7572 | | |
7573 | 7573 | | |
7574 | 7574 | | |
| 7575 | + | |
7575 | 7576 | | |
7576 | 7577 | | |
7577 | 7578 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8942 | 8942 | | |
8943 | 8943 | | |
8944 | 8944 | | |
| 8945 | + | |
8945 | 8946 | | |
8946 | 8947 | | |
8947 | 8948 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12444 | 12444 | | |
12445 | 12445 | | |
12446 | 12446 | | |
| 12447 | + | |
12447 | 12448 | | |
12448 | 12449 | | |
12449 | 12450 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13928 | 13928 | | |
13929 | 13929 | | |
13930 | 13930 | | |
| 13931 | + | |
13931 | 13932 | | |
13932 | 13933 | | |
13933 | 13934 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
506 | 506 | | |
507 | 507 | | |
508 | 508 | | |
509 | | - | |
| 509 | + | |
| 510 | + | |
| 511 | + | |
| 512 | + | |
| 513 | + | |
| 514 | + | |
| 515 | + | |
510 | 516 | | |
511 | 517 | | |
512 | 518 | | |
| |||
Lines changed: 10 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
13 | 23 | | |
14 | 24 | | |
15 | 25 | | |
| |||
0 commit comments