Skip to content

Commit 868f293

Browse files
committed
Implement CodeRabbit feedback
1 parent 3ed3cac commit 868f293

2 files changed

Lines changed: 6 additions & 6 deletions

File tree

src/app/endpoints/rags.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
from authentication.interface import AuthTuple
1212
from authorization.middleware import authorize
1313
from client import AsyncLlamaStackClientHolder
14-
from configuration import configuration
14+
from configuration import LogicError, configuration
1515
from models.config import Action
1616
from models.responses import (
1717
ForbiddenResponse,
@@ -119,7 +119,7 @@ def _resolve_rag_id_to_vector_db_id(rag_id: str) -> str:
119119
"""
120120
try:
121121
byok_rags = configuration.configuration.byok_rag
122-
except (AttributeError, RuntimeError):
122+
except (AttributeError, RuntimeError, LogicError):
123123
return rag_id
124124

125125
for brag in byok_rags:

tests/unit/app/endpoints/test_rags.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -292,7 +292,7 @@ def _make_byok_config(tmp_path: Any) -> AppConfig:
292292

293293
@pytest.mark.asyncio
294294
async def test_rags_endpoint_returns_rag_ids_from_config(
295-
mocker: MockerFixture, tmp_path: str
295+
mocker: MockerFixture, tmp_path: Path
296296
) -> None:
297297
"""Test that /rags endpoint maps llama-stack IDs to user-facing rag_ids."""
298298
byok_config = _make_byok_config(str(tmp_path))
@@ -333,7 +333,7 @@ def __init__(self) -> None:
333333

334334
@pytest.mark.asyncio
335335
async def test_rag_info_endpoint_accepts_rag_id_from_config(
336-
mocker: MockerFixture, tmp_path: str
336+
mocker: MockerFixture, tmp_path: Path
337337
) -> None:
338338
"""Test that /rags/{rag_id} accepts a user-facing rag_id and resolves it."""
339339
byok_config = _make_byok_config(str(tmp_path))
@@ -375,7 +375,7 @@ def __init__(self) -> None:
375375

376376

377377
def test_resolve_rag_id_to_vector_db_id_with_mapping(
378-
mocker: MockerFixture, tmp_path: str
378+
mocker: MockerFixture, tmp_path: Path
379379
) -> None:
380380
"""Test that _resolve_rag_id_to_vector_db_id maps rag_id to vector_db_id."""
381381
byok_config = _make_byok_config(str(tmp_path))
@@ -385,7 +385,7 @@ def test_resolve_rag_id_to_vector_db_id_with_mapping(
385385

386386

387387
def test_resolve_rag_id_to_vector_db_id_passthrough(
388-
mocker: MockerFixture, tmp_path: str
388+
mocker: MockerFixture, tmp_path: Path
389389
) -> None:
390390
"""Test that unmapped IDs are passed through unchanged."""
391391
byok_config = _make_byok_config(str(tmp_path))

0 commit comments

Comments
 (0)