Add project-aware boost to raw query
This commit is contained in:
@@ -393,3 +393,26 @@ def test_project_update_endpoint_rejects_collisions(tmp_data_dir, monkeypatch):
|
||||
|
||||
assert response.status_code == 400
|
||||
assert "collisions" in response.json()["detail"]
|
||||
|
||||
|
||||
def test_query_endpoint_accepts_project_hint(monkeypatch):
|
||||
def fake_retrieve(prompt, top_k=10, filter_tags=None, project_hint=None):
|
||||
assert prompt == "architecture"
|
||||
assert top_k == 3
|
||||
assert project_hint == "p04-gigabit"
|
||||
return []
|
||||
|
||||
monkeypatch.setattr("atocore.api.routes.retrieve", fake_retrieve)
|
||||
|
||||
client = TestClient(app)
|
||||
response = client.post(
|
||||
"/query",
|
||||
json={
|
||||
"prompt": "architecture",
|
||||
"top_k": 3,
|
||||
"project": "p04-gigabit",
|
||||
},
|
||||
)
|
||||
|
||||
assert response.status_code == 200
|
||||
assert response.json()["results"] == []
|
||||
|
||||
Reference in New Issue
Block a user