DeepSeek AI
Integrate DeepSeek LLM models into Delphi, C++ Builder and .NET applications. OpenAI-compatible chat completions with streaming and vision, ideal for coding and reasoning tasks.
Integrate DeepSeek LLM models into Delphi, C++ Builder and .NET applications. OpenAI-compatible chat completions with streaming and vision, ideal for coding and reasoning tasks.
DeepSeek REST API client for chat messages, vision and model listing, using an OpenAI-compatible request format.
TsgcHTTP_API_DeepSeek
DeepSeek REST API over HTTPS
Windows, macOS, Linux, iOS, Android
Enterprise (AI add-on)
Set the API key in DeepSeekOptions, then call typed helper methods such as _CreateMessage or build a TsgcDeepSeekClass_Request_ChatCompletion and call CreateMessage.
uses
sgcHTTP_API_DeepSeek;
var
DeepSeek: TsgcHTTP_API_DeepSeek;
begin
DeepSeek := TsgcHTTP_API_DeepSeek.Create(nil);
DeepSeek.DeepSeekOptions.ApiKey := 'YOUR_API_KEY';
// Simple one-shot message
Memo1.Lines.Text := DeepSeek._CreateMessage(
'deepseek-chat',
'What are the benefits of WebSockets?');
// Streaming, handle OnHTTPAPISSE per delta
DeepSeek.OnHTTPAPISSE := HandleSSE;
DeepSeek._CreateMessageStream(
'deepseek-chat',
'Summarise RFC 6455');
end;
procedure TForm1.HandleSSE(Sender: TObject;
const aEvent, aData: string;
var Cancel: Boolean);
begin
Memo1.Lines.Add(aEvent + ': ' + aData);
end;
// uses: sgcHTTP_API_DeepSeek
TsgcHTTP_API_DeepSeek *DeepSeek = new TsgcHTTP_API_DeepSeek(this);
DeepSeek->DeepSeekOptions->ApiKey = "YOUR_API_KEY";
// Simple one-shot message
Memo1->Lines->Text = DeepSeek->_CreateMessage(
"deepseek-chat",
"What are the benefits of WebSockets?");
// Streaming, OnHTTPAPISSE fires per delta
DeepSeek->OnHTTPAPISSE = HandleSSE;
DeepSeek->_CreateMessageStream(
"deepseek-chat",
"Summarise RFC 6455");
using esegece.sgcWebSockets;
var deepseek = new TsgcHTTPAPI_DeepSeek();
deepseek.DeepSeekOptions.ApiKey = "YOUR_API_KEY";
// Simple one-shot message
Console.WriteLine(deepseek._CreateMessage(
"deepseek-chat",
"What are the benefits of WebSockets?"));
// Streaming via Server-Sent Events
deepseek.OnHTTPAPISSE += (sender, ev, data, cancel) => Console.Write(data);
deepseek._CreateMessageStream(
"deepseek-chat",
"Summarise RFC 6455");
Typed request / response classes for chat completions, plus string shortcuts for messages, vision and model listing.
CreateMessage sends a typed TsgcDeepSeekClass_Request_ChatCompletion and returns a parsed response. _CreateMessage, _CreateMessageWithSystem and _CreateMessageStream are JSON-string shortcuts, with streaming delivered through OnHTTPAPISSE.
_CreateVisionMessage sends a base64-encoded image alongside a text prompt, accepting image/jpeg, image/png, image/gif and image/webp media types for image understanding.
_GetModels lists the available DeepSeek models, such as deepseek-chat and deepseek-reasoner, so you can target the right model for coding or reasoning tasks.
Requests follow the OpenAI Chat Completions schema against https://api.deepseek.com/v1/chat/completions, so existing OpenAI client code can be reused by swapping the component and supplying a DeepSeek model name.
CircuitBreaker short-circuits requests when the API is unhealthy; ReadTimeout and TLSOptions tune the HTTPS layer; OnHTTPAPIException surfaces failures; OnHTTPAPISSE streams server-sent events.
Authoritative sources for the protocols this component implements.
Deep-link to the component reference, grab the ready-to-run demo project, and download the trial.
| Online Help — DeepSeek Full property, method and event reference for this component. | Open | |
| Demo Project — Demos\AI\DeepSeek Ready-to-run example project. Ships inside the sgcWebSockets package — download the trial below. | Open | |
| User Manual (PDF) Comprehensive manual covering every component in the library. | Open |