Skip to content

Conversation

@subtleGradient
Copy link
Contributor

Add FileParserPlugin example for AI SDK v5

  • Add PDF fixtures (small, medium, large, xlarge) with verification codes
  • Create comprehensive file-parser example testing all PDF sizes
  • Uses AI SDK's file attachment format with automatic plugin enablement
  • Validates extraction of verification codes from PDFs

Add shared fixtures module and JSON metadata

  • Create shared/fixtures.ts with utilities for reading PDF fixtures
  • Use absolute paths so examples work from any directory
  • Read verification codes from JSON metadata instead of hard-coding
  • Update AI SDK example to use shared fixtures
  • Add JSON metadata files generated by generate-pdfs.sh script

Fix stylecheck issues in AI SDK examples

  • Remove 'any' type assertion, use proper type narrowing
  • Fix import order with biome autofix

Add FileParserPlugin example for Effect AI

  • Add PDF fixtures (small, medium, large, xlarge) with verification codes
  • Create comprehensive file-parser example testing all PDF sizes
  • Uses Effect AI's type-safe composition with file parser plugin
  • Demonstrates layer-based dependency injection and concurrent processing
  • Validates extraction of verification codes from PDFs

Update Effect AI example to use shared fixtures module

  • Import utilities from @openrouter-examples/shared/fixtures
  • Read verification codes from JSON metadata
  • Use absolute paths for PDF files
  • Remove hard-coded EXPECTED_CODES

Copy link
Contributor Author

subtleGradient commented Nov 12, 2025

Warning

This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
Learn more

This stack of pull requests is managed by Graphite. Learn more about stacking.

@subtleGradient subtleGradient changed the title Add FileParserPlugin example for AI SDK v5 Add FileParserPlugin example for Effect AI Nov 12, 2025
@subtleGradient subtleGradient marked this pull request as ready for review November 12, 2025 22:47
Copilot AI review requested due to automatic review settings November 12, 2025 22:47
Copilot finished reviewing on behalf of subtleGradient November 12, 2025 22:51
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds a comprehensive FileParserPlugin example for Effect AI, demonstrating how to process PDF files using OpenRouter's file parser plugin with Effect's type-safe, composable architecture.

Key Changes:

  • Adds Effect AI example with layer-based dependency injection and concurrent PDF processing
  • Demonstrates proper file attachment handling using Prompt.makePart('file', ...)
  • Implements Effect patterns including Effect.gen, error handling with Effect.catchAll, and concurrent execution with Effect.all

Reviewed Changes

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

File Description
typescript/effect-ai/src/plugin-file-parser/file-parser-all-sizes.ts Main example demonstrating FileParserPlugin with Effect AI patterns for processing multiple PDF sizes concurrently
typescript/effect-ai/src/plugin-file-parser/README.md Documentation explaining the Effect AI integration features and usage instructions
Comments suppressed due to low confidence (1)

typescript/effect-ai/src/plugin-file-parser/file-parser-all-sizes.ts:30

  • Unused import getPdfPath.
import {
  type PdfSize,
  PDF_SIZES,
  extractCode,
  formatSize,
  getPdfPath,
  getPdfSize,
  readExpectedCode,
  readPdfAsDataUrl,
} from '@openrouter-examples/shared/fixtures';

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

Add Effect AI example that demonstrates PDF processing using:
- Effect.gen for effect composition
- Layer-based dependency injection
- Type-safe error handling
- Shared fixtures module for PDF test files

No PDF fixtures included - these should be inherited from pdf-example-fetch in the stack.
Copy link

@louisgv louisgv left a comment

Choose a reason for hiding this comment

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

This example turned into super complex here? -- I think we need a simple example still.

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.

3 participants