From efae51dc50c06dd93db856ace67daae0263be974 Mon Sep 17 00:00:00 2001 From: Patrick Buckley Date: Mon, 15 Jun 2026 16:25:01 -0700 Subject: [PATCH] feat(attachments): accept pdf/audio uploads in the UI + admin capability toggles - composer: accept pdf/audio in the upload picker; client-side kind inference for the optimistic chip (server classify_upload stays authoritative) - admin Models tab: supports_pdf + supports_audio_input toggles (flow through the field-aware capabilities merge into ModelCapabilities, so flipping supports_audio_input on an omni alias enables native input_audio) - docs: AttachmentInfo.kind, AttachmentUpload, and the TS SDK note pdf/audio --- sdk/typescript/src/types.ts | 2 +- turnstone/api/server_schemas.py | 5 ++++- turnstone/console/static/admin.js | 4 ++++ turnstone/console/static/index.html | 12 ++++++++++++ turnstone/sdk/_types.py | 4 ++-- turnstone/shared_static/composer.js | 15 ++++++--------- turnstone/shared_static/composer_attachments.js | 14 ++++++++++++-- 7 files changed, 41 insertions(+), 15 deletions(-) diff --git a/sdk/typescript/src/types.ts b/sdk/typescript/src/types.ts index f3000c71..7402dfb7 100644 --- a/sdk/typescript/src/types.ts +++ b/sdk/typescript/src/types.ts @@ -96,7 +96,7 @@ export interface AttachmentInfo { filename: string; mime_type: string; size_bytes: number; - /** "image" or "text". */ + /** "image", "text", "pdf", or "audio". */ kind: string; } diff --git a/turnstone/api/server_schemas.py b/turnstone/api/server_schemas.py index bf50127f..c99b5668 100644 --- a/turnstone/api/server_schemas.py +++ b/turnstone/api/server_schemas.py @@ -74,7 +74,10 @@ class AttachmentInfo(BaseModel): filename: str = Field(description="Original upload filename") mime_type: str = Field(description="Canonicalized MIME type") size_bytes: int = Field(description="Payload size in bytes") - kind: str = Field(description="'image' or 'text'", examples=["image", "text"]) + kind: str = Field( + description="'image', 'text', 'pdf', or 'audio'", + examples=["image", "text", "pdf", "audio"], + ) class UploadAttachmentResponse(AttachmentInfo): diff --git a/turnstone/console/static/admin.js b/turnstone/console/static/admin.js index e2bf29fc..f3a4e4aa 100644 --- a/turnstone/console/static/admin.js +++ b/turnstone/console/static/admin.js @@ -5097,22 +5097,26 @@ const _MODEL_CAP_KEYS = [ "supports_tools", "supports_streaming", "supports_vision", + "supports_pdf", "supports_web_search", "supports_temperature", "supports_effort", "supports_transcription", "supports_speech_synthesis", + "supports_audio_input", "supports_rerank", ]; const _MODEL_CAP_DEFAULTS = { supports_tools: true, supports_streaming: true, supports_vision: false, + supports_pdf: false, supports_web_search: false, supports_temperature: true, supports_effort: false, supports_transcription: false, supports_speech_synthesis: false, + supports_audio_input: false, supports_rerank: false, }; let _modelCapsBaseline = {}; // known-model table values (display + delta base) diff --git a/turnstone/console/static/index.html b/turnstone/console/static/index.html index 3f42833d..2c30fe33 100644 --- a/turnstone/console/static/index.html +++ b/turnstone/console/static/index.html @@ -1769,6 +1769,12 @@ >Vision + +