goutamadwant opened a new issue, #13741:
URL: https://github.com/apache/seatunnel/issues/13741

   ### Search before asking
   
   - [x] I had searched in the 
[feature](https://github.com/apache/seatunnel/issues?q=is%3Aissue+label%3A%22Feature%22)
 and found no similar feature requirement.
   
   ### Description
   
   The LLM transform sends one HTTP request per row. `process_batch_size` is in 
its option rule and the Chinese doc (default 100), but nothing reads it 
(`LLMTransform.getOutputFieldValue`, dev `0bef81d003`). The model layer already 
accepts a list of rows and asks for an array of results.
   
   A transform cannot hold rows back today: nothing lets it emit before a 
checkpoint barrier or at end of input, so buffering would lose rows.
   
   Proposal:
   
   - `SeaTunnelFlatMapTransform#flush()` (default empty): engines call it 
before a checkpoint barrier, on a flush signal, before a schema change and at 
end of input.
   - Zeta `TransformFlowLifeCycle`, a small Flink operator 
(`prepareSnapshotPreBarrier`, `endInput`) and Spark `mapPartitions` call it.
   - LLM transform holds `process_batch_size` rows and sends one request; 
default 1 keeps today's behaviour.
   - Wrong number of answers or a failed request: that batch falls back to one 
request per row.
   
   Implemented locally with unit tests for all three engines and an E2E case 
(five rows, batch size 2, mock server verifies three requests). Can be split 
into API/engine and LLM PRs.
   
   ### Usage Scenario
   
   Labelling a few hundred thousand rows with an OpenAI-compatible model: 20 
rows per request needs 5% of the requests and stays under the rate limit.
   
   ### Related issues
   
   - #13184 (LLM retries) is a separate concern; the two compose.
   
   ### Are you willing to submit a PR?
   
   - [x] Yes I am willing to submit a PR!
   
   ### Code of Conduct
   
   - [x] I agree to follow this project's [Code of 
Conduct](https://www.apache.org/foundation/policies/conduct)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to