mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-04-28 18:36:23 +02:00
- Added `citations_enabled` and `qna_custom_instructions` fields to the SearchSpace model for better QnA configuration. - Updated the creation and update schemas to handle new fields with appropriate defaults. - Refactored QnA handling in the agent to utilize the new SearchSpace fields for improved response customization. - Adjusted UI components to include settings for managing QnA configurations. - Enhanced onboarding process to incorporate prompt setup as an optional step.
36 lines
941 B
Python
36 lines
941 B
Python
import uuid
|
|
from datetime import datetime
|
|
|
|
from pydantic import BaseModel, ConfigDict
|
|
|
|
from .base import IDModel, TimestampModel
|
|
|
|
|
|
class SearchSpaceBase(BaseModel):
|
|
name: str
|
|
description: str | None = None
|
|
|
|
|
|
class SearchSpaceCreate(SearchSpaceBase):
|
|
# Optional on create, will use defaults if not provided
|
|
citations_enabled: bool = True
|
|
qna_custom_instructions: str | None = None
|
|
|
|
|
|
class SearchSpaceUpdate(BaseModel):
|
|
# All fields optional on update - only send what you want to change
|
|
name: str | None = None
|
|
description: str | None = None
|
|
citations_enabled: bool | None = None
|
|
qna_custom_instructions: str | None = None
|
|
|
|
|
|
class SearchSpaceRead(SearchSpaceBase, IDModel, TimestampModel):
|
|
id: int
|
|
created_at: datetime
|
|
user_id: uuid.UUID
|
|
# QnA configuration
|
|
citations_enabled: bool
|
|
qna_custom_instructions: str | None = None
|
|
|
|
model_config = ConfigDict(from_attributes=True)
|