SurfSense/surfsense_backend/app/schemas/search_space.py
Anish Sarkar d40c6bf743 feat: integrate SearXNG web search service with platform capabilities
- Added SearXNG service configuration to Docker setup, including environment variables and health checks.
- Introduced new settings management for web search in the frontend, allowing users to enable/disable and configure search engines and language preferences.
- Updated backend to support web search functionality, including database schema changes and service integration.
- Implemented health check endpoint for the web search service and integrated it into the application.
- Removed legacy SearXNG API connector references in favor of the new platform service approach.
2026-03-14 20:25:25 +05:30

47 lines
1.2 KiB
Python

import uuid
from datetime import datetime
from typing import Any
from pydantic import BaseModel, ConfigDict
from .base import IDModel, TimestampModel
class SearchSpaceBase(BaseModel):
name: str
description: str | None = None
class SearchSpaceCreate(SearchSpaceBase):
citations_enabled: bool = True
qna_custom_instructions: str | None = None
web_search_enabled: bool = True
web_search_config: dict[str, Any] | None = None
class SearchSpaceUpdate(BaseModel):
name: str | None = None
description: str | None = None
citations_enabled: bool | None = None
qna_custom_instructions: str | None = None
web_search_enabled: bool | None = None
web_search_config: dict[str, Any] | None = None
class SearchSpaceRead(SearchSpaceBase, IDModel, TimestampModel):
id: int
created_at: datetime
user_id: uuid.UUID
citations_enabled: bool
qna_custom_instructions: str | None = None
web_search_enabled: bool
web_search_config: dict[str, Any] | None = None
model_config = ConfigDict(from_attributes=True)
class SearchSpaceWithStats(SearchSpaceRead):
"""Extended search space info with member count and ownership status."""
member_count: int = 1
is_owner: bool = False