With TsgcAIChat, deltas already decoded
Call ChatStream instead of Chat and handle OnChatStream. The component asks the provider for a streamed response, parses each Server-Sent Event and hands you aChunk, which is the new text and nothing else. You append it, and that is the whole implementation.
Every provider streams a different JSON shape. OpenAI, DeepSeek, Ollama, Grok and Mistral put the text in choices[0].delta.content, Claude in delta.text, Gemini deeper still inside candidates. TsgcAIChat already knows which one applies to the provider you selected, so your handler never sees JSON.
Set Cancel to True inside the handler to stop a runaway answer. The request is abandoned at that point, and no further chunks arrive. When the stream ends, the assembled text is added to the history and returned by ChatStream, and OnChatMessage fires once with the complete answer.