TsgcAIOpenAIChatBot › Methods › ChatAsSystem
Sends a system-role instruction to steer the assistant; speech output is off by default.
void __fastcall ChatAsSystem(const UnicodeString aText, bool aTextToSpeech = False, TsgcOpenAIArray_Request_Completion_Messages * aHistory = 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.