TsgcHTTP_API_Anthropic › Events › OnHTTPAPISSE
Fires for every Server-Sent Event received from a streaming Anthropic response
property OnHTTPAPISSE: TsgcHTTPAPISSEEvent;
// TsgcHTTPAPISSEEvent = procedure(Sender: TObject; const aEvent, aData: string; var Cancel: Boolean) of object
—
When CreateMessage is invoked with streaming enabled, the Anthropic endpoint POST /v1/messages returns a text/event-stream. This event fires for each decoded SSE frame with aEvent (e.g. message_start, content_block_delta, message_stop) and aData (the JSON payload). Set Cancel to True to abort the stream before the server finishes sending it.
procedure TForm1.oAPIHTTPAPISSE(Sender: TObject; const aEvent, aData: string;
var Cancel: Boolean);
begin
if aEvent = 'content_block_delta' then
Memo1.Lines.Add(aData);
end;