The guides
Pick the job you are doing
Each summary below is long enough to answer the question on its own, so you can decide whether the full page is worth your next twenty minutes before you open it.
Call an LLM from Delphi
Send a prompt from a VCL, FMX or console application and get an answer back, from a hosted model such as OpenAI or Anthropic Claude, or from a model running on your own machine through Ollama. There are two routes. TsgcAIChat puts every provider behind one API, so changing vendor is a single assignment to Provider, and the per-vendor clients TsgcHTTP_API_OpenAI, TsgcHTTP_API_Anthropic and TsgcHTTP_API_Ollama expose each vendor API in full when you need vision input, batches, embeddings or transcription.
The page then covers the three things every project hits next. Streaming, so text appears in the memo while the model is still writing, at both the decoded-delta level and the raw event level. Tool calling, where you describe a Pascal function as JSON Schema and the model asks you to run it. And the choice between a hosted model and a local one, which for anything covered by a data processing agreement is a compliance decision rather than a performance one.
Needs: sgcWebSockets Enterprise or the standalone sgcAI package. The REST clients compile on Windows, macOS, Linux, iOS and Android; TsgcAIChat is Windows only, so the page shows both routes.
Read the guide →
Sign a user in with OAuth2 and PKCE
The Authorization Code flow with PKCE, which is the flow every provider now expects from a native desktop application, driven by one non-visual component. No embedded browser, no web server of your own, no REST framework. TsgcHTTP_OAuth2_Client generates the verifier, derives the challenge, opens the system browser, listens on a loopback redirect, exchanges the code and fires OnAfterAccessToken with the token.
Where the flow goes wrong on the desktop is the redirect, so the page spends real time on it: why the redirect is a loopback address and not a public URL, what to register with the provider, and what redirect_uri_mismatch is telling you. It then covers refresh tokens, so the browser never opens a second time, storing a credential without leaving it lying around, the ready-made Google and Microsoft components, and the XOAUTH2 hand-off that Gmail and Microsoft 365 now require over SMTP and IMAP.
Needs: sgcWebSockets Standard and above, or the standalone sgcAuth package. Windows, macOS, Linux, iOS and Android. Only the authorization server half is an Enterprise feature.
Read the guide →
Connect two Delphi applications with WebRTC
Two applications on two different networks, exchanging a chat channel, a microphone stream and a camera stream directly between each other, with no media server in the middle and no browser embedded in the process. The page splits WebRTC into the four problems it actually is: describing the session as an SDP offer and answer, carrying that description to the other side, finding a path through the NATs, and moving the bytes.
Signalling is the part you write yourself, so it is here in full as a dumb relay over TsgcWebSocketServer with three message kinds. Then the peer connection and its events, ICE candidates and what host, server reflexive and relay candidates each cost you, the TURN switch people forget, SCTP data channels with per-channel reliability, and audio and video tracks, which are a different transport with different failure modes from a data channel. It closes on the failures that produce no error at all, which is what makes peer to peer hard to debug.
Needs: the peer connection, ICE and TURN clients come with sgcWebSockets Enterprise. The offer and answer methods, data channels and media tracks need the sgcWebRTC pack on top of Enterprise, which is also included in All-Access. A STUN client arrives with Standard.
Read the guide →