Skip to content

feat: add text processing with media payloads - #1

Merged
gabewillen merged 4 commits into
mainfrom
feat/text-media-payload
Oct 20, 2026
Merged

gabewillen merged 4 commits into
mainfrom
feat/text-media-payload

Conversation

@gabewillen

Copy link
Copy Markdown
Contributor

Summary

  • expose text processing with arbitrary source media payloads and MIME types
  • add JSON/options and map-returning variants using the new core C API symbol
  • document the API and verify binary/MIME preservation in tests

Validation

  • go test . -short
  • go test . -run TestMakeNativeMediaPreservesArbitraryBinaryAndMIME -count=1

The core native release containing cortext_process_text_with_media_json_with_options must be available for the end-to-end native test; this PR does not merge that core change.

Copilot AI lite review requested due to automatic review settings August 6, 2026 23:52

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a new text-processing API surface that can attach arbitrary source media (binary payload + MIME type) to text inputs, aligning text processing with existing audio/image “with media” flows.

Changes:

  • Introduces ProcessTextWithMedia* (JSON/options/map variants) backed by a new native C API symbol.
  • Registers the new native symbol in the purego FFI layer.
  • Documents the new API and adds a unit test to verify binary/MIME preservation in the Go-to-native media marshaling.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
README.md Documents how to call ProcessTextWithMedia and clarifies binary/MIME preservation.
ffi.go Adds a new purego-registered native symbol for text processing with media.
cortext.go Adds Handle methods for text processing with optional media and options.
cortext_test.go Adds a unit test validating makeNativeMedia preserves arbitrary bytes and MIME type.
CHANGELOG.md Notes the new text-with-media processing API in the Unreleased section.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread ffi.go Resolved
Comment thread cortext_test.go Resolved
Comment thread cortext.go Resolved
@gabewillen

Copy link
Copy Markdown
Contributor Author

Legacy native compatibility fix pushed in 03bad64.

  • cortext_process_text_with_media_json_with_options is now optional during purego registration; missing symbols no longer abort LoadLibrary.
  • ProcessTextWithMedia returns native library does not support text media processing when unavailable.
  • Added focused optional-registration/unsupported-capability tests.

Validation:

  • go test . -short
  • CGO_ENABLED=0 go test . -short

Both pass.

@gabewillen

Copy link
Copy Markdown
Contributor Author

Superseded by #2, which merges this branch and reconciles it with the engine v5 work (evidence budget, reference time and the corrected media semantics). I'm leaving this PR open for now.

@gabewillen
gabewillen merged commit 75d715d into main Oct 20, 2026
4 checks passed
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.

2 participants