Skip to content

feat: added facets endpoint #737#741

Merged
NoopDog merged 5 commits intomainfrom
mim/737-facets-endpoint
Dec 13, 2025
Merged

feat: added facets endpoint #737#741
NoopDog merged 5 commits intomainfrom
mim/737-facets-endpoint

Conversation

@MillenniumFalconMechanic
Copy link
Collaborator

Ticket

Closes #737.

Changes

This pull request introduces a minimal FastAPI backend for the Findable project, providing a stubbed query-to-facets API endpoint for early experimentation. It includes the initial backend structure, request/response models, a controller, a service with a hard-coded response, and developer documentation. Additionally, it adds Python formatting checks and required dependencies.

Backend implementation:

  • Added a FastAPI application in backend/main.py that registers a /api/v0/facets endpoint via the facets_controller router. [1] [2]
  • Implemented request (FacetsRequest) and response (FacetsResponse, FacetSelection, SelectedValue) models using Pydantic for the facets endpoint. [1] [2]
  • Created a stubbed service (compute_facets_from_query) that returns a hard-coded facets response for proof-of-concept purposes.

Developer experience and documentation:

  • Added backend/README.md with setup instructions, endpoint details, and example usage for running and formatting the backend.
  • Introduced Python dependencies (fastapi, uvicorn, pydantic, black) in backend/requirements.txt.
  • Updated .husky/pre-commit to check Python code formatting with Black before commits.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR introduces a minimal FastAPI backend to support early experimentation with a query-to-facets API endpoint. The implementation provides a foundation for LLM-backed intent parsing with a stubbed service layer that returns hard-coded responses for proof-of-concept purposes.

Key changes:

  • Added a FastAPI application with POST /api/v0/facets endpoint for converting natural language queries to facet selections
  • Implemented Pydantic models for request/response validation with multi-level nested structures
  • Integrated Python code formatting with Black into the pre-commit workflow

Reviewed changes

Copilot reviewed 8 out of 12 changed files in this pull request and generated 10 comments.

Show a summary per file
File Description
backend/main.py FastAPI application entry point that registers the facets router
backend/controllers/facets_controller.py API router defining the POST endpoint and delegating to the service layer
backend/controllers/models.py Pydantic request model for the facets endpoint
backend/services/facets_service.py Service function returning stubbed facet data for PoC
backend/services/models.py Pydantic response models (FacetsResponse, FacetSelection, SelectedValue)
backend/requirements.txt Python dependencies including FastAPI, Uvicorn, Pydantic, and Black
backend/README.md Developer documentation for setup, running, and testing the backend
.husky/pre-commit Added Black formatter check to pre-commit hooks
.gitignore Added Python-specific ignore patterns (.venv, pycache, *.pyc)
Comments suppressed due to low confidence (2)

backend/controllers/facets_controller.py:2

  • Import of 'BaseModel' is not used.
from pydantic import BaseModel

backend/services/facets_service.py:3

  • Import of 'BaseModel' is not used.
from pydantic import BaseModel

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 8 out of 12 changed files in this pull request and generated 4 comments.

Comments suppressed due to low confidence (1)

backend/controllers/facets_controller.py:2

  • Import of 'BaseModel' is not used.
from pydantic import BaseModel

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 8 out of 12 changed files in this pull request and generated 2 comments.

@NoopDog NoopDog merged commit c7d4445 into main Dec 13, 2025
2 checks passed
@MillenniumFalconMechanic MillenniumFalconMechanic deleted the mim/737-facets-endpoint branch December 15, 2025 21:03
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.

Add query-to-facets API endpoint (stub only)

3 participants