TsgcAIOpenAIChatBot › Methods › ChatAsSystem
Sends a system-role instruction to steer the assistant; speech output is off by default.
procedure ChatAsSystem(const aText: string; aTextToSpeech: Boolean = False; aHistory: TsgcOpenAIArray_Request_Completion_Messages = nil);
| Name | Type | Description |
|---|---|---|
aText | const string | The system-role instruction that conditions the assistant (for example persona, tone, or RAG context). |
aTextToSpeech | Boolean | When True, the assistant reply is also spoken through TextToSpeech. Defaults to False. |
aHistory | TsgcOpenAIArray_Request_Completion_Messages | Optional earlier messages that should precede the system instruction. Pass nil to start fresh. |
Use this method to inject persona or retrieval context before the next user turn. Because no user prompt is sent, aTextToSpeech defaults to False — the assistant would just acknowledge the instruction. Combine ChatAsSystem with a follow-up ChatAsUser to implement a RAG workflow.
sgcChatBot.ChatAsSystem('You are a concise technical-support agent.');
sgcChatBot.ChatAsUser('My camera shows a black screen. What do I try first?');