feat(rag): global tuning manager — /tuning.html + PUT /api/steering/{id}: create, edit, list, delete steering notes without a chat
This commit is contained in:
@@ -126,6 +126,22 @@ class SteeringNoteIn(BaseModel):
|
||||
return v.strip() if isinstance(v, str) else v
|
||||
|
||||
|
||||
class SteeringNoteUpdate(BaseModel):
|
||||
"""``PUT /api/steering/{id}`` body: a new tuning instruction (phase 27).
|
||||
|
||||
Mirrors :class:`SteeringNoteIn` — the note is trimmed *before* the
|
||||
length constraints run, so an empty/whitespace body is a 422 and a
|
||||
full replacement that is ≤2000 chars after the trim still passes.
|
||||
"""
|
||||
|
||||
note: str = Field(min_length=1, max_length=2000)
|
||||
|
||||
@field_validator("note", mode="before")
|
||||
@classmethod
|
||||
def _trim_note(cls, v: object) -> object:
|
||||
return v.strip() if isinstance(v, str) else v
|
||||
|
||||
|
||||
class SteeringNote(BaseModel):
|
||||
"""One stored steering note (API shape — ISO-8601 ``created_at``)."""
|
||||
|
||||
|
||||
Reference in New Issue
Block a user