TsgcAIOpenAIEmbeddings › Events › OnCreateEmbeddingsProgress
Fired after each chunk is processed, reporting the current position in the input.
property OnCreateEmbeddingsProgress: TsgcOpenAICreateEmbeddingsProgress;
// TsgcOpenAICreateEmbeddingsProgress = procedure(Sender: TObject; aPosition: Int64; var aContinue: Boolean) of object
—
Fires once per chunk, after the chunk has been sent and stored. aPosition is the 1-based character offset of the chunk inside the original input and should be matched against the aSize value received in OnCreateEmbeddingsStart to compute progress. Use this event to refresh a progress bar or, by setting aContinue to False, to abort further processing in the current batch.
procedure TForm1.oEmbeddingsCreateEmbeddingsProgress(Sender: TObject;
aPosition: Int64; var aContinue: Boolean);
begin
ProgressBar1.Position := aPosition;
aContinue := not FCancelRequested;
end;