Repository navigation
Parse code, email, xlsb and video attachments; transcribe video with OpenAI - #455
Merged
Merged
Conversation
…OpenAI Code and config files (.sql, .py, .ps1, .sh, .js, .ts, .css, .ini and others) are read as plain text, honoring UTF-8 and UTF-16 byte order marks. .eml and Outlook .msg become headers, body and attachment names (.msg through olefile). .xlsb converts through LibreOffice like .xls. Video transcription can use a registered OpenAI model ([parser] transcription_model, e.g. gpt-transcribe): ffmpeg cuts the audio into two-minute MP3 pieces, silent videos skip it, and lines carry [mm:ss] times. It calls the OpenAI SDK directly because LiteLLM sends verbose_json, which gpt-transcribe rejects. Sampled frames that barely changed since the last described one are no longer sent to the vision model ([parser.vision] frame_change_threshold). Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
ArnavAgrawal03
force-pushed
the
arnav/attachment-types
branch
from
October 26, 2026 16:57
61ae378 to
6625274
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Core skipped several common attachment types as unsupported: videos (
.mp4,.webm), Outlook and MIME emails (.msg,.eml), SQL and other scripts, and.xlsbworkbooks. This makes Core read all of them.Changes
.sql .py .ps1 .sh .bat .cmd .js .ts .css .ini .cfg .conf .toml .propertiesskip Docling, like.txt. Newcore/parser/text_files.pyhonors UTF-8 and UTF-16 byte order marks (SSMS saves.sqlas UTF-16 LE), then tries UTF-8, then cp1252..tsis not a video.mimetypesmaps.tstovideo/mp2t, so_is_video_fileno longer guesses from the filename for text extensions, only from content.core/parser/email_parser.py..emluses stdlibemail; Outlook.msgreads its OLE property streams witholefile(BSD, new dependency). I avoidedextract-msgbecause it's GPL-3.0. Both render From/To/Cc/Date/Subject, the body (HTML converted to text when there's no plain body), and the attachment names. Attachment contents are not parsed. A.msgthat isn't an OLE file fails with the reason..xlsbgoes through the LibreOffice legacy-Office conversion to.xlsx, like.xls.[parser] transcription_modelnames a registered model, e.g.openai_gpt_transcribe = { model_name = "openai/gpt-transcribe" }. Startup validates it, as forimage_ocr_model.verbose_jsonto OpenAI models without "gpt-4o" in the name, andgpt-transcriberejects that with HTTP 400 (checked live, see Testing). It sendsjsonforgpt-*models andverbose_jsonwith segment timestamps forwhisper*.ConnectionErrorso the worker retries. A broken audio track logs a warning and the frames still get indexed.transcription_modeltakes precedence overASSEMBLYAI_API_KEY.[parser.vision] frame_change_threshold(default 0.025; 0 turns it off). A sampled frame is skipped when no tile of an 8x8 grid over a 128x72 grayscale copy changed by more than the threshold since the last described frame. Measured on synthetic frames: a moved cursor scores 0.015, a new line of text 0.054, compression noise 0.004.[mm:ss](h:mm:sspast an hour).video_metadatagainsframe_change_thresholdandframes_unchanged.Testing
test_text_and_email_parsing18,test_video_transcription13,test_video_parser5,test_legacy_office_parsing8 passed and 1 skipped (needs LibreOffice),test_image_ocr_model15,test_docling_picture_text3,test_week1_ingest_fixes20,test_logs_no_egress1: all passed.test_document_download.pyandtest_reranker.pyhang locally, the same way on unmodified main, so I didn't get a full-suite run.VideoParser.get_model_transcripton generated speech:gpt-transcribeandjson: exact transcript.gpt-transcribewithverbose_json:400 response_format 'verbose_json' is not compatible with model 'gpt-transcribe-api-ev3'. Use 'json' or 'text' instead.whisper-1(verbose_json): segment timestamps, but it made up repeated lines through long silences.gpt-transcribedidn't, so the docs recommend it. whisper-1 shuts down Feb 26, 2027..msgparsing was smoke-tested on six real Outlook messages; every field came out. No content from them is in the repo.Not in this change
.mp3,.wav) don't take the video path.🤖 Generated with Claude Code
Need help on this PR? Tag
@codesmith-botwith what you need.