mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2026-11-13 23:47:39 +00:00
Added an analyzer which keeps line breaks LF on every system (#1193)
This commit is contained in:
1 parent
b1c1f13993
commit
65d50de033
96 files changed
+741
-393
No files matched your search
@@ -113,7 +113,7 @@ internal sealed class AssistantDropdown : StatefulAssistantComponentBase
|
||||
public override string UserPromptFallback(AssistantState state)
|
||||
{
|
||||
if (this.IsMultiselect && state.MultiSelect.TryGetValue(this.Name, out var selections))
|
||||
return this.BuildAuditPromptBlock(string.Join(Environment.NewLine, selections.OrderBy(static value => value, StringComparer.Ordinal)));
|
||||
return this.BuildAuditPromptBlock(string.Join('\n', selections.OrderBy(static value => value, StringComparer.Ordinal)));
|
||||
|
||||
state.SingleSelect.TryGetValue(this.Name, out var userInput);
|
||||
return this.BuildAuditPromptBlock(userInput);
|
||||
|
||||
+1
-1
@@ -57,7 +57,7 @@ internal sealed class AssistantFileAttachment : StatefulAssistantComponentBase
|
||||
var builder = new StringBuilder();
|
||||
|
||||
foreach (var attachment in fileState.DocumentPaths.OrderBy(static attachment => attachment.FilePath, StringComparer.Ordinal))
|
||||
builder.AppendLine(attachment.FilePath);
|
||||
builder.AppendLineLF(attachment.FilePath);
|
||||
|
||||
return this.BuildAuditPromptBlock(builder.ToString());
|
||||
}
|
||||
|
||||
+2
-2
@@ -282,14 +282,14 @@ internal static class AssistantLuaConversion
|
||||
var indent = new string(' ', depth * 2);
|
||||
var childIndent = new string(' ', (depth + 1) * 2);
|
||||
var builder = new System.Text.StringBuilder();
|
||||
builder.AppendLine("{");
|
||||
builder.AppendLineLF("{");
|
||||
|
||||
foreach (var entry in table)
|
||||
{
|
||||
builder.Append(childIndent);
|
||||
builder.Append(FormatLuaValue(entry.Key));
|
||||
builder.Append(" = ");
|
||||
builder.AppendLine(FormatLuaValue(entry.Value, depth + 1));
|
||||
builder.AppendLineLF(FormatLuaValue(entry.Value, depth + 1));
|
||||
}
|
||||
|
||||
builder.Append(indent);
|
||||
|
||||
+7
-7
@@ -18,13 +18,13 @@ public abstract class StatefulAssistantComponentBase : NamedAssistantComponentBa
|
||||
var builder = new StringBuilder();
|
||||
var fieldName = this.Type.ToString().ToLowerInvariant();
|
||||
|
||||
builder.AppendLine($"[{fieldName}]");
|
||||
builder.Append("name: ").AppendLine(this.Name);
|
||||
builder.AppendLine("context:");
|
||||
builder.AppendLine(!string.IsNullOrEmpty(this.UserPrompt) ? this.UserPrompt : "<not provided>");
|
||||
builder.AppendLine("value:");
|
||||
builder.AppendLine(!string.IsNullOrEmpty(value) ? value : "<empty>");
|
||||
builder.Append($"[/{fieldName}]").AppendLine().AppendLine();
|
||||
builder.AppendLineLF($"[{fieldName}]");
|
||||
builder.Append("name: ").AppendLineLF(this.Name);
|
||||
builder.AppendLineLF("context:");
|
||||
builder.AppendLineLF(!string.IsNullOrEmpty(this.UserPrompt) ? this.UserPrompt : "<not provided>");
|
||||
builder.AppendLineLF("value:");
|
||||
builder.AppendLineLF(!string.IsNullOrEmpty(value) ? value : "<empty>");
|
||||
builder.Append($"[/{fieldName}]").AppendLineLF().AppendLineLF();
|
||||
return builder.ToString();
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user