Skip to content

✨ feat(conversion): convert files without storing memories - #105

Merged
marcelsamyn merged 1 commit into
mainfrom
feat/file-conversion-api
Nov 3, 2026
Merged

marcelsamyn merged 1 commit into
mainfrom
feat/file-conversion-api

Conversation

@marcelsamyn

@marcelsamyn marcelsamyn commented Nov 3, 2026 •

Copy link
Copy Markdown
Owner

Summary

Clients can convert files to Markdown without storing a source or starting memory extraction. This supplies the shared conversion service for reading documents attached to Petals chats.

Related: https://github.com/marcelsamyn-org/petals/pull/448

POST /convert/file and MemoryClient.convertFile accept PDF, DOCX, PPTX, XLSX, HTML, text, and JSON. The endpoint reuses MarkItDown, authenticates before reading the body, and limits the complete multipart stream as well as the file. Parameterized MIME types use their normalized media type. Conversion has a 120-second deadline and a 10 Mi-character output limit.

Rollout

Configure MEMORY_API_KEY on the Memory server to match the credential used by the caller. An unset key returns 503; missing or incorrect credentials return 401. Deploy this endpoint before the Petals attachment reader. Petals calls the HTTP endpoint with its existing configuration, so that rollout does not require publishing a new SDK version.

Validation

  • pnpm test --run src/convert-file-route.test.ts: 38 HTTP and SDK tests pass, including chunked oversized bodies, oversized ignored parts, MIME parameters, auth failures, and invalid converter responses.
  • pnpm build:check, pnpm build-sdk, production build, lint, formatting, and diff checks pass.
  • Built Nitro API with the real MarkItDown service converted PDF, DOCX, PPTX, XLSX, text, and JSON. Parameterized HTML converted to Markdown; an oversized chunked request returned 413.
  • The companion Petals browser test uploaded a real Word file through the visible file picker and received an answer based on the converted content.
  • Coverage instrumentation was not run. No database migration is required.

Compound Engineering

@marcelsamyn

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 3, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-03T13:35:31.567212Z 62928da Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Can't wait for the next one!

Reviewed commit: 62928da5f0

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@marcelsamyn
marcelsamyn force-pushed the feat/file-conversion-api branch from 62928da to dbd7960 Compare November 3, 2026 13:59
@marcelsamyn
marcelsamyn merged commit 36e79b1 into main Nov 3, 2026
1 check passed
@marcelsamyn
marcelsamyn deleted the feat/file-conversion-api branch November 3, 2026 14:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant