File tree Expand file tree Collapse file tree 4 files changed +13
-8
lines changed
Expand file tree Collapse file tree 4 files changed +13
-8
lines changed Original file line number Diff line number Diff line change 22from pydantic import BaseModel
33
44from backend .services .facets_service import compute_facets_from_query
5- from backend .services .facets_service import FacetsResponse
5+ from backend .services .models import FacetsResponse
66
77from backend .controllers .models import FacetsRequest
88
1111
1212@router .post ("" )
1313def get_facets (payload : FacetsRequest ) -> FacetsResponse :
14- # NOTE: Stubbed PoC implementation. This will be replaced by
15- # LLM-backed intent parsing and real facet resolution in a later step .
16- # For now, delegate to the service layer so the controller stays thin.
14+ """
15+ Return a stubbed query-to-facets response for PoC purposes .
16+ """
1717 return compute_facets_from_query ()
Original file line number Diff line number Diff line change 11from pydantic import BaseModel
22
33
4- # Model of the request body for the /api/v0/facets endpoint.
54class FacetsRequest (BaseModel ):
5+ """
6+ Request model for the /api/v0/facets endpoint.
7+ Attributes:
8+ query (str): The search query string to retrieve facets for.
9+ """
10+
611 query : str
Original file line number Diff line number Diff line change 11from __future__ import annotations
22
3- from pydantic import BaseModel
4-
5-
63from backend .services .models import FacetsResponse
74
85
Original file line number Diff line number Diff line change @@ -10,6 +10,7 @@ class SelectedValue(BaseModel):
1010 term (str): The resolved facet value.
1111 mention (str): The original query text that resolved to the value.
1212 """
13+
1314 term : str
1415 mention : str
1516
@@ -23,6 +24,7 @@ class FacetSelection(BaseModel):
2324 facet (str): The name of the facet.
2425 selectedValues (list[SelectedValue]): The list of selected values for this facet.
2526 """
27+
2628 facet : str
2729 selectedValues : list [SelectedValue ]
2830
@@ -36,5 +38,6 @@ class FacetsResponse(BaseModel):
3638 query (str): The original query string.
3739 facets (list[FacetSelection]): The list of selected facets and their values.
3840 """
41+
3942 query : str
4043 facets : list [FacetSelection ]
You can’t perform that action at this time.
0 commit comments