Skip to content

Conversation

@akshaydeo
Copy link
Contributor

@akshaydeo akshaydeo commented Dec 15, 2025

Summary

Added support for file-based batch input testing and improved batch request handling in the Gemini provider.

Changes

  • Added a new FileBatchInput flag to test scenarios to explicitly track whether a provider supports file-based input for batch operations
  • Updated the file and batch integration test to check for FileBatchInput instead of requiring both FileUpload and BatchCreate
  • Improved message extraction in Gemini's batch request handling to support multiple data formats
  • Updated provider test configurations to accurately reflect file capabilities:
    • Anthropic: Disabled file content and file batch input support
    • Bedrock: Enabled file batch input support
    • Gemini: Disabled file content but enabled file batch input support
    • OpenAI: Enabled file batch input support

Type of change

  • Bug fix
  • Feature
  • Refactor
  • Documentation
  • Chore/CI

Affected areas

  • Core (Go)
  • Transports (HTTP)
  • Providers/Integrations
  • Plugins
  • UI (Next.js)
  • Docs

How to test

Run the provider tests to verify file and batch integration:

# Test all providers
go test ./core/providers/...

# Test specific providers
go test ./core/providers/gemini/...
go test ./core/providers/anthropic/...
go test ./core/providers/bedrock/...
go test ./core/providers/openai/...

Breaking changes

  • Yes
  • No

Related issues

N/A

Security considerations

No security implications.

Checklist

  • I added/updated tests where appropriate
  • I verified builds succeed (Go and UI)
  • I verified the CI pipeline passes locally if applicable

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Dec 15, 2025

Caution

Review failed

The pull request is closed.

📝 Walkthrough

Summary by CodeRabbit

  • New Features

    • Added support for batch input file handling across provider integrations (Anthropic, Bedrock, Gemini, OpenAI).
  • Improvements

    • Enhanced message format flexibility in batch processing for improved compatibility.
  • Tests

    • Extended test coverage for batch input file scenarios and refined provider-specific test configurations.

✏️ Tip: You can customize this high-level summary in your review settings.

Walkthrough

A new FileBatchInput boolean field is added to the TestScenarios struct to indicate batch create file-based input support. Test configurations across multiple providers are updated to set this flag appropriately. The batch integration test skip condition is refactored to check only FileBatchInput instead of both file upload and batch create support. Gemini's batch message extraction logic is enhanced to handle multiple data shapes.

Changes

Cohort / File(s) Summary
TestScenarios struct and integration test utilities
core/internal/testutil/account.go, core/internal/testutil/batch.go, core/internal/testutil/tests.go
Added FileBatchInput boolean field to TestScenarios struct. Updated RunFileAndBatchIntegrationTest skip condition to check only FileBatchInput instead of both FileUpload and BatchCreate. Updated test summary enabled condition to use FileBatchInput.
Provider test configurations
core/providers/anthropic/anthropic_test.go, core/providers/bedrock/bedrock_test.go, core/providers/gemini/gemini_test.go, core/providers/openai/openai_test.go
Added FileBatchInput field to test scenario configurations with provider-specific values: false for Anthropic (inline-only support), true for Bedrock, Gemini, and OpenAI. Anthropic also disables FileContent test flag. Gemini also disables FileContent test flag.
Gemini batch message extraction
core/providers/gemini/batch.go
Refactored buildBatchRequestItems to support multiple shapes of request data messages field: []interface{}, []map[string]interface{}, and []map[string]string. Introduced two-step processing: collect messages into temporary collection, then transform into final Contents with Roles and Parts. Maintains system message skipping and metadata assignment for CustomID.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

  • Gemini batch.go refactoring: The multi-shape message extraction logic with type conversions and the two-step processing approach requires careful review to ensure correctness across all input formats.
  • Provider-specific configuration consistency: Verify that FileBatchInput settings align with each provider's actual API capabilities (especially Anthropic's inline-only constraint).
  • Integration test control flow change: Confirm that checking only FileBatchInput (instead of both FileUpload and BatchCreate) correctly captures the intended skip conditions across all test scenarios.

Poem

🐰 A batch of files hops into place,
One flag to rule the testing race,
No more two checks, now FileBatchInput leads,
Gemini's messages bloom like garden seeds,
From shapes varied, one truth proceeds! 📁✨

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch 12-15-adds_new_file-supported-batch_flag_for_tests

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 4a63f58 and 50d0563.

📒 Files selected for processing (8)
  • core/internal/testutil/account.go (1 hunks)
  • core/internal/testutil/batch.go (1 hunks)
  • core/internal/testutil/tests.go (1 hunks)
  • core/providers/anthropic/anthropic_test.go (1 hunks)
  • core/providers/bedrock/bedrock_test.go (1 hunks)
  • core/providers/gemini/batch.go (1 hunks)
  • core/providers/gemini/gemini_test.go (1 hunks)
  • core/providers/openai/openai_test.go (1 hunks)

Comment @coderabbitai help to get the list of available commands and usage tips.

@akshaydeo akshaydeo marked this pull request as ready for review December 15, 2025 18:04
@github-actions
Copy link
Contributor

🧪 Test Suite Available

This PR can be tested by a repository admin.

Run tests for PR #1097

Copy link
Contributor Author

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

@akshaydeo akshaydeo merged commit b5df028 into main Dec 15, 2025
10 of 11 checks passed
@akshaydeo akshaydeo deleted the 12-15-adds_new_file-supported-batch_flag_for_tests branch December 15, 2025 18:05
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