This commit is contained in:
2026-11-01 18:11:26 +03:30
parent ce5db9e349
commit 51dddb4b68
2 changed files with 30 additions and 14 deletions
+12 -7
View File
@@ -1342,23 +1342,28 @@ namespace xAiApi.Providers
//
var contextBlock = BuildContextBlock(context);
var systemText =
$"{introductionPrompt}{Environment.NewLine}{Environment.NewLine}" +
$"{ragPrompt}{Environment.NewLine}{Environment.NewLine}" +
$"Context:{Environment.NewLine}{contextBlock}";
var systemText = introductionPrompt;
if (context.HasChild() &&
!contextBlock.IsNullOrEmpty())
{
//
systemText =
$"{introductionPrompt}{Environment.NewLine}{Environment.NewLine}" +
$"{ragPrompt}{Environment.NewLine}{Environment.NewLine}" +
$"Context:{Environment.NewLine}{contextBlock}";
}
//
// Apply Project Prompt as System Text ...
if (!project.IsNullOrDefault() &&
!project.Prompt.IsNullOrEmpty())
{
systemText += $"Project:{Environment.NewLine}{project.Prompt}";
systemText += $"{project.Prompt}{Environment.NewLine}";
}
//
// Add System Message ...
result
.Add(new ChatMessage(ChatRole.System, systemText));
result.Add(new ChatMessage(ChatRole.System, systemText));
//
// Attach Message ...