mirror of
https://github.com/turnstonelabs/turnstone.git
synced 2026-08-12 23:12:23 -06:00
feat(attachments): native PDF + audio translators, accept on upload
PDF and audio attachments now work end-to-end on the native provider lanes; non-native lanes degrade to a placeholder (client-side fallback lands next). Capability flags are populated but not yet consumed by a wire-build gate. - providers: Anthropic PDF -> base64 document; OpenAI Responses PDF -> input_file; compat/Google inline_document_parts PDF -> placeholder (fixes the base64-as-text mangle); audio = input_audio passthrough on the compat lane (omni), defensive text placeholders on Anthropic + Responses - capabilities: supports_pdf on cloud Claude + OpenAI chat models; local/default/compat stay False (-> client-side fallback) - upload: classifier accepts pdf (32 MiB) + audio (25 MiB); endpoint multipart read cap raised to PDF_SIZE_CAP - hygiene: consolidate the duplicated upload classification into one attachments.classify_upload (+ UploadRejection); collapse AttachmentUploadHelpers to a single classify_upload callable - tests: PDF/audio translator shapes, capability flags, classify_upload
This commit is contained in:
@@ -48,10 +48,7 @@ from turnstone.console.server import (
|
||||
coordinator_tasks,
|
||||
)
|
||||
from turnstone.core.attachments import (
|
||||
classify_text_attachment as _coord_test_classify_text,
|
||||
)
|
||||
from turnstone.core.attachments import (
|
||||
sniff_image_mime as _coord_test_sniff_image,
|
||||
classify_upload as _coord_test_classify_upload,
|
||||
)
|
||||
from turnstone.core.auth import AuthResult
|
||||
from turnstone.core.session_routes import (
|
||||
@@ -107,8 +104,7 @@ _coord_endpoint_config = SessionEndpointConfig(
|
||||
supports_attachments=True,
|
||||
attachment_owner_resolver=_coord_attach_owner,
|
||||
attachment_helpers=AttachmentUploadHelpers(
|
||||
sniff_image_mime=_coord_test_sniff_image,
|
||||
classify_text_attachment=_coord_test_classify_text,
|
||||
classify_upload=_coord_test_classify_upload,
|
||||
),
|
||||
spawn_metrics=None,
|
||||
emit_message_queued=True,
|
||||
|
||||
Reference in New Issue
Block a user