AI ChatBot Component
Build conversational AI interfaces with human-like interactions. Powered by leading AI models, integrated natively in Delphi.
Build conversational AI interfaces with human-like interactions. Powered by leading AI models, integrated natively in Delphi.
Plug-and-play voice chatbot — capture microphone audio, transcribe with Whisper, send to ChatCompletions, speak the answer back through a text-to-speech provider.
TsgcAIOpenAIChatBot
Voice front-end on top of OpenAI Whisper + Chat Completions
Windows, macOS, Linux, iOS, Android
Enterprise (AI add-on)
Plug an AudioRecorder + TextToSpeech into a TsgcAIOpenAIChatBot, set the API key, call Start.
uses
sgcAI, sgcAI_OpenAI, sgcAI_OpenAI_Audio_ChatBot,
sgcAI_AudioRecorder_MCI, sgcAI_TextToSpeech_System;
var
ChatBot: TsgcAIOpenAIChatBot;
Recorder: TsgcAudioRecorderMCI;
TTS: TsgcTextToSpeechSystem;
begin
Recorder := TsgcAudioRecorderMCI.Create(nil);
TTS := TsgcTextToSpeechSystem.Create(nil);
ChatBot := TsgcAIOpenAIChatBot.Create(nil);
ChatBot.OpenAIOptions.ApiKey := 'sk-...';
ChatBot.AudioRecorder := Recorder;
ChatBot.TextToSpeech := TTS;
ChatBot.OnAudioStart := ChatBotAudioStart;
ChatBot.OnAudioStop := ChatBotAudioStop;
ChatBot.OnTranscription := ChatBotTranscription;
ChatBot.OnChatCompletion := ChatBotChatCompletion;
ChatBot.Start; // begin microphone capture; Stop ends it
// You can also push a turn programmatically:
ChatBot.ChatAsUser('Tell me a joke about Delphi');
end;
procedure TForm1.ChatBotChatCompletion(Sender: TObject;
const Role, Content: string);
begin
memoLog.Lines.Add(Role + ': ' + Content);
end;
6 published properties, 4 methods, 4 events — pulled from the component reference.
Published properties: OpenAIOptions, ChatBotOptions.
Published properties: Version.
Properties: TextToSpeech, AudioRecorder.
Properties: Embeddings.
Methods: ChatAsUser, ChatAsSystem.
Methods: Start, Stop.
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 — TsgcAIOpenAIChatBot Full property, method and event reference for this component. | Open | |
| Demo Project — Demos\AI\ChatBot Ready-to-run example project. Ships inside the sgcWebSockets package — download the trial below. | Open | |
| Technical Document (PDF) Features, quick start, code samples for Delphi & C++ Builder and primary-source references — this component only. | Open | |
| User Manual (PDF) Comprehensive manual covering every component in the library. | Open |