TsgcAIOpenAIEmbeddingsEvents › OnCreateEmbeddingsProgress

OnCreateEmbeddingsProgress Event

Fired after each chunk is processed, reporting the current position in the input.

Syntax

property OnCreateEmbeddingsProgress: TsgcOpenAICreateEmbeddingsProgress;
// TsgcOpenAICreateEmbeddingsProgress = procedure(Sender: TObject; aPosition: Int64; var aContinue: Boolean) of object

Default Value

Remarks

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.

Example

procedure TForm1.oEmbeddingsCreateEmbeddingsProgress(Sender: TObject;
  aPosition: Int64; var aContinue: Boolean);
begin
  ProgressBar1.Position := aPosition;
  aContinue := not FCancelRequested;
end;

Back to Events