mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2026-11-04 21:07:21 +00:00
Generated the JSON contracts of the stored data at compile time (#1148)
This commit is contained in:
1 parent
fc7399e81b
commit
e954881fda
75 files changed
+5437
-298
No files matched your search
@@ -13,11 +13,11 @@ public sealed class AssistantAuditFinding
|
||||
/// </summary>
|
||||
#pragma warning restore MWAIS0005
|
||||
[JsonIgnore]
|
||||
public AssistantAuditLevel Severity { get; private init; } = AssistantAuditLevel.UNKNOWN;
|
||||
public AssistantAuditLevel Severity { get; private set; } = AssistantAuditLevel.UNKNOWN;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Gets or initializes the JSON-facing severity label used by the audit model response.
|
||||
/// Gets or sets the JSON-facing severity label used by the audit model response.
|
||||
/// </summary>
|
||||
[JsonPropertyName("severity")]
|
||||
public string SeverityText
|
||||
@@ -30,7 +30,7 @@ public sealed class AssistantAuditFinding
|
||||
_ => "unknown",
|
||||
};
|
||||
|
||||
init => this.Severity = value.Trim().ToLowerInvariant() switch
|
||||
set => this.Severity = value.Trim().ToLowerInvariant() switch
|
||||
{
|
||||
"critical" => AssistantAuditLevel.DANGEROUS,
|
||||
"medium" => AssistantAuditLevel.CAUTION,
|
||||
@@ -39,7 +39,7 @@ public sealed class AssistantAuditFinding
|
||||
};
|
||||
}
|
||||
|
||||
public string Category { get; init; } = string.Empty;
|
||||
public string Location { get; init; } = string.Empty;
|
||||
public string Description { get; init; } = string.Empty;
|
||||
public string Category { get; set; } = string.Empty;
|
||||
public string Location { get; set; } = string.Empty;
|
||||
public string Description { get; set; } = string.Empty;
|
||||
}
|
||||
@@ -10,13 +10,22 @@ internal static class SwotAnalysisContentPresentation
|
||||
/// Fails the reading of stored data which holds a null where the result expects a value, so that
|
||||
/// the result view never meets one.
|
||||
/// </summary>
|
||||
private static readonly JsonSerializerOptions JSON_OPTIONS = new()
|
||||
internal static readonly JsonSerializerOptions JSON_OPTIONS = new JsonSerializerOptions
|
||||
{
|
||||
RespectNullableAnnotations = true,
|
||||
};
|
||||
TypeInfoResolver = SwotAnalysisJsonContext.Default,
|
||||
}.AsReadOnly();
|
||||
|
||||
/// <summary>
|
||||
/// Writes the analysis with the defaults of System.Text.Json, which let a null pass, unlike the reading.
|
||||
/// </summary>
|
||||
internal static readonly JsonSerializerOptions WRITE_OPTIONS = new JsonSerializerOptions
|
||||
{
|
||||
TypeInfoResolver = SwotAnalysisJsonContext.Default,
|
||||
}.AsReadOnly();
|
||||
|
||||
public static ContentPresentation Create(SwotAnalysisResult result) =>
|
||||
ContentPresentation.Create(ContentPresentationKind.SWOT_ANALYSIS, result);
|
||||
ContentPresentation.Create(ContentPresentationKind.SWOT_ANALYSIS, result, WRITE_OPTIONS);
|
||||
|
||||
/// <summary>
|
||||
/// Reads the SWOT analysis stored as the presentation of a text, so it can be shown as a matrix.
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace AIStudio.Assistants.SWOTAnalysis;
|
||||
|
||||
/// <summary>
|
||||
/// The contracts with which System.Text.Json reads and writes a SWOT analysis which a chat stores, built at
|
||||
/// compile time.
|
||||
/// </summary>
|
||||
[JsonSourceGenerationOptions(GenerationMode = JsonSourceGenerationMode.Metadata)]
|
||||
[JsonSerializable(typeof(SwotAnalysisResult))]
|
||||
internal sealed partial class SwotAnalysisJsonContext : JsonSerializerContext;
|
||||
@@ -26,11 +26,16 @@ public sealed class ChatDraft
|
||||
{
|
||||
private readonly Lock stateLock = new();
|
||||
|
||||
//
|
||||
// The setters are internal only for reading the JSON, since its source generation reaches no private
|
||||
// setter. Everything else changes the draft through the methods below, which hold the lock.
|
||||
//
|
||||
|
||||
/// <summary>
|
||||
/// The text of the message.
|
||||
/// </summary>
|
||||
[JsonInclude]
|
||||
public string Text { get; private set; } = string.Empty;
|
||||
public string Text { get; internal set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// The files attached to the message, the transcripts of audio and video files included.
|
||||
@@ -40,7 +45,7 @@ public sealed class ChatDraft
|
||||
/// transcript is still a transcript after the chat was loaded again.
|
||||
/// </remarks>
|
||||
[JsonInclude]
|
||||
public IReadOnlyList<FileAttachment> FileAttachments { get; private set; } = [];
|
||||
public IReadOnlyList<FileAttachment> FileAttachments { get; internal set; } = [];
|
||||
|
||||
/// <summary>
|
||||
/// The texts a preview read of the attached files, which sending takes along instead of reading the files again.
|
||||
@@ -53,7 +58,7 @@ public sealed class ChatDraft
|
||||
/// store holds the texts themselves.
|
||||
/// </remarks>
|
||||
[JsonInclude]
|
||||
public IReadOnlyList<PreviewedText> PreviewedTexts { get; private set; } = [];
|
||||
public IReadOnlyList<PreviewedText> PreviewedTexts { get; internal set; } = [];
|
||||
|
||||
/// <summary>
|
||||
/// Whether the draft holds neither text nor attachments.
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
using ERIContentType = AIStudio.Tools.ERIClient.DataModel.ContentType;
|
||||
|
||||
namespace AIStudio.Chat;
|
||||
|
||||
/// <summary>
|
||||
/// The contracts with which System.Text.Json reads and writes chats, built at compile time.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Two types with the same name need a name of their own for their contract, else the generator builds
|
||||
/// only the first of them and warns with SYSLIB1031.
|
||||
/// </remarks>
|
||||
[JsonSourceGenerationOptions(GenerationMode = JsonSourceGenerationMode.Metadata)]
|
||||
[JsonSerializable(typeof(ChatThread))]
|
||||
[JsonSerializable(typeof(ERIContentType), TypeInfoPropertyName = "ERIContentType")]
|
||||
internal sealed partial class ChatJsonContext : JsonSerializerContext;
|
||||
@@ -23,7 +23,7 @@ public sealed record ChatThread
|
||||
/// <summary>
|
||||
/// The unique identifier of the chat thread.
|
||||
/// </summary>
|
||||
public Guid ChatId { get; init; }
|
||||
public Guid ChatId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The unique identifier of the workspace.
|
||||
@@ -42,16 +42,16 @@ public sealed record ChatThread
|
||||
/// Every copy of this thread made with a with expression shares the draft, because such a copy is
|
||||
/// still the same chat. A copy which becomes another chat needs a draft of its own.
|
||||
/// </remarks>
|
||||
public ChatDraft Draft { get; init; } = new();
|
||||
public ChatDraft Draft { get; set; } = new();
|
||||
|
||||
// Compatibility shim: until v26.9.1, a chat stored only the transcripts of its draft, in a list of their own. See documentation/compatibility-shims/2026-10-chat-pending-media-transcripts.md; remove after 2027-04-11.
|
||||
[JsonInclude]
|
||||
[JsonPropertyName("pending_media_transcripts")]
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
|
||||
private List<ManagedTranscriptAttachment>? LegacyPendingMediaTranscripts
|
||||
internal List<ManagedTranscriptAttachment>? LegacyPendingMediaTranscripts
|
||||
{
|
||||
get => null;
|
||||
init
|
||||
set
|
||||
{
|
||||
if (value is not null)
|
||||
this.Draft.AddAttachments(value);
|
||||
@@ -127,7 +127,7 @@ public sealed record ChatThread
|
||||
/// continues it must meet the level.
|
||||
/// </summary>
|
||||
[JsonInclude]
|
||||
public ConfidenceLevel RequiredProviderConfidence { get; private set; } = ConfidenceLevel.NONE;
|
||||
public ConfidenceLevel RequiredProviderConfidence { get; internal set; } = ConfidenceLevel.NONE;
|
||||
|
||||
public void RequireProviderConfidence(ConfidenceLevel minimumProviderConfidence)
|
||||
{
|
||||
@@ -164,7 +164,7 @@ public sealed record ChatThread
|
||||
/// internal content demands nothing.
|
||||
/// </remarks>
|
||||
[JsonInclude]
|
||||
public OutboundDataRequirement RequiredOutboundDataRestriction { get; private set; } = OutboundDataRequirement.NONE;
|
||||
public OutboundDataRequirement RequiredOutboundDataRestriction { get; internal set; } = OutboundDataRequirement.NONE;
|
||||
|
||||
/// <summary>
|
||||
/// Tightens where this chat may still send data to what the data brought in demands, and
|
||||
@@ -229,7 +229,7 @@ public sealed record ChatThread
|
||||
/// immutable, so that a copy of the thread never shares a set which grows later.
|
||||
/// </remarks>
|
||||
[JsonInclude]
|
||||
public ImmutableHashSet<string> WebAddressesWrittenByModels { get; private set; } = [];
|
||||
public ImmutableHashSet<string> WebAddressesWrittenByModels { get; internal set; } = [];
|
||||
|
||||
/// <summary>
|
||||
/// The name of the chat thread. Usually generated by an AI model or manually edited by the user.
|
||||
@@ -244,7 +244,7 @@ public sealed record ChatThread
|
||||
/// <summary>
|
||||
/// The content blocks of the chat thread.
|
||||
/// </summary>
|
||||
public List<ContentBlock> Blocks { get; init; } = [];
|
||||
public List<ContentBlock> Blocks { get; set; } = [];
|
||||
|
||||
/// <summary>
|
||||
/// The component running this thread, which decides the tools it may use and what its requests name.
|
||||
|
||||
@@ -8,12 +8,12 @@ public class ContentBlock
|
||||
/// <summary>
|
||||
/// Time when the content block was created.
|
||||
/// </summary>
|
||||
public DateTimeOffset Time { get; init; }
|
||||
public DateTimeOffset Time { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Type of the content block, e.g., text, image, voice, etc.
|
||||
/// </summary>
|
||||
public ContentType ContentType { get; init; } = ContentType.NONE;
|
||||
public ContentType ContentType { get; set; } = ContentType.NONE;
|
||||
|
||||
/// <summary>
|
||||
/// The content of the block.
|
||||
@@ -28,7 +28,7 @@ public class ContentBlock
|
||||
/// <summary>
|
||||
/// Should the content block be hidden from the user?
|
||||
/// </summary>
|
||||
public bool HideFromUser { get; init; }
|
||||
public bool HideFromUser { get; set; }
|
||||
|
||||
public ContentBlock DeepClone(bool changeHideState = false, bool hideFromUser = true) => new()
|
||||
{
|
||||
|
||||
@@ -58,7 +58,7 @@ public sealed class ContentImage : IContent, IImageSource
|
||||
/// <remarks>
|
||||
/// Is the image source a URL, a local file path, a base64 string, etc.?
|
||||
/// </remarks>
|
||||
public required ContentImageSource SourceType { get; init; }
|
||||
public required ContentImageSource SourceType { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The image source.
|
||||
|
||||
@@ -33,10 +33,10 @@ public sealed class ContentPresentation
|
||||
}
|
||||
}
|
||||
|
||||
internal static ContentPresentation Create<T>(ContentPresentationKind kind, T data) => new()
|
||||
internal static ContentPresentation Create<T>(ContentPresentationKind kind, T data, JsonSerializerOptions options) => new()
|
||||
{
|
||||
Kind = kind,
|
||||
Data = JsonSerializer.SerializeToElement(data),
|
||||
Data = JsonSerializer.SerializeToElement(data, options),
|
||||
};
|
||||
|
||||
internal ContentPresentation DeepClone() => new()
|
||||
|
||||
@@ -15,8 +15,22 @@ namespace AIStudio.Chat;
|
||||
[JsonDerivedType(typeof(FileAttachment), typeDiscriminator: "file")]
|
||||
[JsonDerivedType(typeof(FileAttachmentImage), typeDiscriminator: "image")]
|
||||
[JsonDerivedType(typeof(ManagedTranscriptAttachment), typeDiscriminator: "managed_transcript")]
|
||||
public record FileAttachment(FileAttachmentType Type, string FileName, [property: JsonConverter(typeof(DataDirectoryRelativePathConverter))] string FilePath, long FileSizeBytes)
|
||||
public record FileAttachment(FileAttachmentType Type, string FileName, string FilePath, long FileSizeBytes)
|
||||
{
|
||||
//
|
||||
// The properties of the parameters, declared again to be settable. A derived attachment gets the type from
|
||||
// its own constructor, and the source generation of System.Text.Json sets every init-only property while it
|
||||
// creates the object, also one missing in the JSON, which would lose that type. Keep them first and in the
|
||||
// order of the parameters, which is the order they get stored in:
|
||||
//
|
||||
public FileAttachmentType Type { get; set; } = Type;
|
||||
public string FileName { get; set; } = FileName;
|
||||
|
||||
[JsonConverter(typeof(DataDirectoryRelativePathConverter))]
|
||||
public string FilePath { get; set; } = FilePath;
|
||||
|
||||
public long FileSizeBytes { get; set; } = FileSizeBytes;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a value indicating whether the file type is forbidden and should not be attached.
|
||||
/// </summary>
|
||||
@@ -69,7 +83,7 @@ public record FileAttachment(FileAttachmentType Type, string FileName, [property
|
||||
/// of chat templates, while null.
|
||||
/// </remarks>
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
|
||||
public Guid? ProvenanceId { get; init; }
|
||||
public Guid? ProvenanceId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The state of the file which the stored text was read from, see ProvenanceId, or null while
|
||||
@@ -80,7 +94,7 @@ public record FileAttachment(FileAttachmentType Type, string FileName, [property
|
||||
/// DataChat.ReadChangedAttachmentsAgain. Left out of the chat file while null.
|
||||
/// </remarks>
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
|
||||
public FileVersion? Version { get; init; }
|
||||
public FileVersion? Version { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Whether the file changed since its text was stored.
|
||||
|
||||
@@ -10,7 +10,7 @@ public record FileAttachmentImage(string FileName, string FilePath, long FileSiz
|
||||
/// <remarks>
|
||||
/// Is the image source a URL, a local file path, a base64 string, etc.?
|
||||
/// </remarks>
|
||||
public ContentImageSource SourceType { get; init; } = ContentImageSource.LOCAL_PATH;
|
||||
public ContentImageSource SourceType { get; set; } = ContentImageSource.LOCAL_PATH;
|
||||
|
||||
/// <summary>
|
||||
/// The image source.
|
||||
|
||||
@@ -8,7 +8,7 @@ public interface IImageSource
|
||||
/// <remarks>
|
||||
/// Is the image source a URL, a local file path, a base64 string, etc.?
|
||||
/// </remarks>
|
||||
public ContentImageSource SourceType { get; init; }
|
||||
public ContentImageSource SourceType { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The image source.
|
||||
|
||||
@@ -20,7 +20,7 @@ public sealed record ReportedTokenUsage
|
||||
/// <summary>
|
||||
/// What everything sent to the model cost.
|
||||
/// </summary>
|
||||
public int PromptTokens { get; init; }
|
||||
public int PromptTokens { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Which model the number was charged for.
|
||||
@@ -31,7 +31,7 @@ public sealed record ReportedTokenUsage
|
||||
/// being an answer about the request which is about to be sent, and the estimate, wrong as it
|
||||
/// is, is at least wrong about the right model.
|
||||
/// </remarks>
|
||||
public string ModelId { get; init; } = string.Empty;
|
||||
public string ModelId { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// How many blocks the conversation had when the request went out, this answer included.
|
||||
@@ -45,7 +45,7 @@ public sealed record ReportedTokenUsage
|
||||
/// Taken when the request is sent rather than when the report arrives: whatever is deleted
|
||||
/// while the answer streams in was still part of what the provider counted.
|
||||
/// </remarks>
|
||||
public int BlockCount { get; init; }
|
||||
public int BlockCount { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// States the stored number as a usage again.
|
||||
|
||||
@@ -22,6 +22,23 @@ public record ChatTemplate(
|
||||
bool IsEnterpriseConfiguration = false,
|
||||
Guid EnterpriseConfigurationPluginId = default) : ConfigurationBaseObject
|
||||
{
|
||||
//
|
||||
// The properties of the parameters, declared again to be settable. The source generation of System.Text.Json
|
||||
// sets every init-only property while it creates the object, also one missing in the JSON, so its value from
|
||||
// the parameterless constructor would get lost. Keep them first and in the order of the parameters, which is
|
||||
// the order they get stored in:
|
||||
//
|
||||
public override uint Num { get; set; } = Num;
|
||||
public override string Id { get; set; } = Id;
|
||||
public override string Name { get; set; } = Name;
|
||||
public string SystemPrompt { get; set; } = SystemPrompt;
|
||||
public string PredefinedUserPrompt { get; set; } = PredefinedUserPrompt;
|
||||
public List<ContentBlock> ExampleConversation { get; set; } = ExampleConversation;
|
||||
public List<FileAttachment> FileAttachments { get; set; } = FileAttachments;
|
||||
public bool AllowProfileUsage { get; set; } = AllowProfileUsage;
|
||||
public override bool IsEnterpriseConfiguration { get; set; } = IsEnterpriseConfiguration;
|
||||
public override Guid EnterpriseConfigurationPluginId { get; set; } = EnterpriseConfigurationPluginId;
|
||||
|
||||
private const string ATTACHMENTS_DIRECTORY = "attachments";
|
||||
|
||||
public ChatTemplate() : this(0, Guid.Empty.ToString(), string.Empty, string.Empty, string.Empty, [], [], false)
|
||||
@@ -38,7 +55,7 @@ public record ChatTemplate(
|
||||
/// A preselection, not a limit: the user changes the selection in the chat as usual, and a
|
||||
/// tool still has to meet the confidence requirements of the provider in use.
|
||||
/// </remarks>
|
||||
public HashSet<string>? ToolIds { get; init; }
|
||||
public HashSet<string>? ToolIds { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The data source options a chat started with this template begins with.
|
||||
@@ -49,7 +66,7 @@ public record ChatTemplate(
|
||||
/// list of sources: whether data sources are used at all, whether an agent picks them, and
|
||||
/// whether the retrieved data is validated.
|
||||
/// </remarks>
|
||||
public DataSourceOptions? DataSourceOptions { get; init; }
|
||||
public DataSourceOptions? DataSourceOptions { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The profile this template preselects for a chat started with it.
|
||||
@@ -63,7 +80,7 @@ public record ChatTemplate(
|
||||
/// nothing for a template which does not allow profiles, and a profile which is gone leaves the
|
||||
/// chat default in place.
|
||||
/// </remarks>
|
||||
public string? ProfileId { get; init; }
|
||||
public string? ProfileId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The provider, and with it the model, this template preselects for a chat started with it.
|
||||
@@ -74,7 +91,7 @@ public record ChatTemplate(
|
||||
/// provider which is gone, or which may not be used for chats, leaves the chat to start as if
|
||||
/// the template said nothing.
|
||||
/// </remarks>
|
||||
public string? ProviderId { get; init; }
|
||||
public string? ProviderId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The name of the workspace a chat started with this template is kept in.
|
||||
@@ -89,7 +106,7 @@ public record ChatTemplate(
|
||||
/// workspace on purpose, for example from the workspace list, stays there, and so does every
|
||||
/// chat while workspaces are switched off.
|
||||
/// </remarks>
|
||||
public string? WorkspaceName { get; init; }
|
||||
public string? WorkspaceName { get; set; }
|
||||
|
||||
private static string TB(string fallbackEN) => I18N.I.T(fallbackEN, typeof(ChatTemplate).Namespace, nameof(ChatTemplate));
|
||||
|
||||
|
||||
@@ -11,32 +11,32 @@ public sealed class Data
|
||||
/// The version of the settings file. Allows us to upgrade the settings
|
||||
/// when a new version is available.
|
||||
/// </summary>
|
||||
public Version Version { get; init; } = Version.V6;
|
||||
public Version Version { get; set; } = Version.V6;
|
||||
|
||||
/// <summary>
|
||||
/// List of configured providers.
|
||||
/// </summary>
|
||||
public List<Provider> Providers { get; init; } = [];
|
||||
public List<Provider> Providers { get; set; } = [];
|
||||
|
||||
/// <summary>
|
||||
/// Settings concerning confidence levels.
|
||||
/// </summary>
|
||||
public DataConfidence Confidence { get; init; } = new(x => x.Confidence);
|
||||
public DataConfidence Confidence { get; set; } = new(x => x.Confidence);
|
||||
|
||||
/// <summary>
|
||||
/// Settings concerning data source security checks.
|
||||
/// </summary>
|
||||
public DataSourceSecuritySettings DataSourceSecurity { get; init; } = new(x => x.DataSourceSecurity);
|
||||
public DataSourceSecuritySettings DataSourceSecurity { get; set; } = new(x => x.DataSourceSecurity);
|
||||
|
||||
/// <summary>
|
||||
/// A collection of embedding providers configured.
|
||||
/// </summary>
|
||||
public List<EmbeddingProvider> EmbeddingProviders { get; init; } = [];
|
||||
public List<EmbeddingProvider> EmbeddingProviders { get; set; } = [];
|
||||
|
||||
/// <summary>
|
||||
/// A collection of speech providers configured.
|
||||
/// </summary>
|
||||
public List<TranscriptionProvider> TranscriptionProviders { get; init; } = [];
|
||||
public List<TranscriptionProvider> TranscriptionProviders { get; set; } = [];
|
||||
|
||||
/// <summary>
|
||||
/// A collection of data sources configured.
|
||||
@@ -59,17 +59,17 @@ public sealed class Data
|
||||
/// <summary>
|
||||
/// Settings which apply to all mailboxes.
|
||||
/// </summary>
|
||||
public DataMailboxes MailboxSettings { get; init; } = new(x => x.MailboxSettings);
|
||||
public DataMailboxes MailboxSettings { get; set; } = new(x => x.MailboxSettings);
|
||||
|
||||
/// <summary>
|
||||
/// List of configured profiles.
|
||||
/// </summary>
|
||||
public List<Profile> Profiles { get; init; } = [];
|
||||
public List<Profile> Profiles { get; set; } = [];
|
||||
|
||||
/// <summary>
|
||||
/// List of configured chat templates.
|
||||
/// </summary>
|
||||
public List<ChatTemplate> ChatTemplates { get; init; } = [];
|
||||
public List<ChatTemplate> ChatTemplates { get; set; } = [];
|
||||
|
||||
/// <summary>
|
||||
/// List of enabled plugins.
|
||||
@@ -161,74 +161,74 @@ public sealed class Data
|
||||
/// </summary>
|
||||
public uint NextDocumentAnalysisPolicyNum { get; set; } = 1;
|
||||
|
||||
public DataApp App { get; init; } = new(x => x.App);
|
||||
public DataApp App { get; set; } = new(x => x.App);
|
||||
|
||||
public DataChat Chat { get; init; } = new(x => x.Chat);
|
||||
public DataChat Chat { get; set; } = new(x => x.Chat);
|
||||
|
||||
public DataWorkspace Workspace { get; init; } = new();
|
||||
public DataWorkspace Workspace { get; set; } = new();
|
||||
|
||||
public DataIconFinder IconFinder { get; init; } = new();
|
||||
public DataIconFinder IconFinder { get; set; } = new();
|
||||
|
||||
public DataTranslation Translation { get; init; } = new();
|
||||
public DataTranslation Translation { get; set; } = new();
|
||||
|
||||
public DataCoding Coding { get; init; } = new();
|
||||
public DataCoding Coding { get; set; } = new();
|
||||
|
||||
public DataERI ERI { get; init; } = new();
|
||||
public DataERI ERI { get; set; } = new();
|
||||
|
||||
public DataDocumentAnalysis DocumentAnalysis { get; init; } = new();
|
||||
public DataDocumentAnalysis DocumentAnalysis { get; set; } = new();
|
||||
|
||||
/// <summary>
|
||||
/// Gets the managed Batch Processing Assistant defaults.
|
||||
/// </summary>
|
||||
public DataBatchProcessing BatchProcessing { get; init; } = new(x => x.BatchProcessing);
|
||||
public DataBatchProcessing BatchProcessing { get; set; } = new(x => x.BatchProcessing);
|
||||
|
||||
public DataMandatoryInformation MandatoryInformation { get; init; } = new();
|
||||
public DataMandatoryInformation MandatoryInformation { get; set; } = new();
|
||||
|
||||
public DataTextSummarizer TextSummarizer { get; init; } = new();
|
||||
public DataTextSummarizer TextSummarizer { get; set; } = new();
|
||||
|
||||
public DataSWOTAnalysis SWOTAnalysis { get; init; } = new();
|
||||
public DataSWOTAnalysis SWOTAnalysis { get; set; } = new();
|
||||
|
||||
public DataTextContentCleaner TextContentCleaner { get; init; } = new();
|
||||
public DataTextContentCleaner TextContentCleaner { get; set; } = new();
|
||||
|
||||
public DataAgentDataSourceSelection AgentDataSourceSelection { get; init; } = new(x => x.AgentDataSourceSelection);
|
||||
public DataAgentDataSourceSelection AgentDataSourceSelection { get; set; } = new(x => x.AgentDataSourceSelection);
|
||||
|
||||
public DataAgentRetrievalContextValidation AgentRetrievalContextValidation { get; init; } = new(x => x.AgentRetrievalContextValidation);
|
||||
public DataAgentRetrievalContextValidation AgentRetrievalContextValidation { get; set; } = new(x => x.AgentRetrievalContextValidation);
|
||||
|
||||
public DataAssistantPluginAudit AssistantPluginAudit { get; init; } = new(x => x.AssistantPluginAudit);
|
||||
public DataAssistantPluginAudit AssistantPluginAudit { get; set; } = new(x => x.AssistantPluginAudit);
|
||||
|
||||
public DataAgenda Agenda { get; init; } = new();
|
||||
public DataAgenda Agenda { get; set; } = new();
|
||||
|
||||
public DataGrammarSpelling GrammarSpelling { get; init; } = new();
|
||||
public DataGrammarSpelling GrammarSpelling { get; set; } = new();
|
||||
|
||||
public DataRewriteImprove RewriteImprove { get; init; } = new();
|
||||
public DataRewriteImprove RewriteImprove { get; set; } = new();
|
||||
|
||||
public DataPromptOptimizer PromptOptimizer { get; init; } = new();
|
||||
public DataPromptOptimizer PromptOptimizer { get; set; } = new();
|
||||
|
||||
public DataEMail EMail { get; init; } = new();
|
||||
public DataEMail EMail { get; set; } = new();
|
||||
|
||||
public DataSlideBuilder SlideBuilder { get; init; } = new(x => x.SlideBuilder);
|
||||
public DataSlideBuilder SlideBuilder { get; set; } = new(x => x.SlideBuilder);
|
||||
|
||||
/// <summary>
|
||||
/// Gets the managed Assistant Builder defaults.
|
||||
/// </summary>
|
||||
public DataAssistantBuilder AssistantBuilder { get; init; } = new(x => x.AssistantBuilder);
|
||||
public DataAssistantBuilder AssistantBuilder { get; set; } = new(x => x.AssistantBuilder);
|
||||
|
||||
/// <summary>
|
||||
/// Gets the managed Visual Briefing Assistant defaults.
|
||||
/// </summary>
|
||||
public DataVisualBriefing VisualBriefing { get; init; } = new(x => x.VisualBriefing);
|
||||
public DataVisualBriefing VisualBriefing { get; set; } = new(x => x.VisualBriefing);
|
||||
|
||||
public DataLegalCheck LegalCheck { get; init; } = new();
|
||||
public DataLegalCheck LegalCheck { get; set; } = new();
|
||||
|
||||
public DataSynonyms Synonyms { get; init; } = new();
|
||||
public DataSynonyms Synonyms { get; set; } = new();
|
||||
|
||||
public DataMyTasks MyTasks { get; init; } = new();
|
||||
public DataMyTasks MyTasks { get; set; } = new();
|
||||
|
||||
public DataJobPostings JobPostings { get; init; } = new();
|
||||
public DataJobPostings JobPostings { get; set; } = new();
|
||||
|
||||
public DataBiasOfTheDay BiasOfTheDay { get; init; } = new();
|
||||
public DataBiasOfTheDay BiasOfTheDay { get; set; } = new();
|
||||
|
||||
public DataI18N I18N { get; init; } = new();
|
||||
public DataI18N I18N { get; set; } = new();
|
||||
|
||||
public DataTools Tools { get; init; } = new(x => x.Tools);
|
||||
public DataTools Tools { get; set; } = new(x => x.Tools);
|
||||
}
|
||||
@@ -398,7 +398,7 @@ public sealed class DataApp(Expression<Func<Data, DataApp>>? configSelection = n
|
||||
/// <summary>
|
||||
/// Settings for indexing local data sources.
|
||||
/// </summary>
|
||||
public DataDataSourceIndexing DataSourceIndexing { get; init; } = new(x => x.App.DataSourceIndexing);
|
||||
public DataDataSourceIndexing DataSourceIndexing { get; set; } = new(x => x.App.DataSourceIndexing);
|
||||
|
||||
/// <summary>
|
||||
/// List of assistants that should be hidden from the UI.
|
||||
|
||||
@@ -5,11 +5,11 @@ namespace AIStudio.Settings.DataModel;
|
||||
/// </summary>
|
||||
public sealed class DataAssistantPluginEnterpriseApproval
|
||||
{
|
||||
public string PluginHash { get; init; } = string.Empty;
|
||||
public string DisplayName { get; init; } = string.Empty;
|
||||
public string Comment { get; init; } = string.Empty;
|
||||
public string ApprovedBy { get; init; } = string.Empty;
|
||||
public DateTimeOffset? ApprovedAtUtc { get; init; }
|
||||
public string PluginHash { get; set; } = string.Empty;
|
||||
public string DisplayName { get; set; } = string.Empty;
|
||||
public string Comment { get; set; } = string.Empty;
|
||||
public string ApprovedBy { get; set; } = string.Empty;
|
||||
public DateTimeOffset? ApprovedAtUtc { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Whether the organization wants this assistant plugin to be enabled, instead of leaving that
|
||||
@@ -21,7 +21,7 @@ public sealed class DataAssistantPluginEnterpriseApproval
|
||||
/// colleague still has to switch it on. This field is how an organization makes that decision
|
||||
/// instead.
|
||||
/// </remarks>
|
||||
public bool Activate { get; init; }
|
||||
public bool Activate { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Whether the user may switch an assistant plugin the organization activated off again.
|
||||
@@ -32,5 +32,5 @@ public sealed class DataAssistantPluginEnterpriseApproval
|
||||
/// change. It has no meaning of its own while Activate is false, because there is nothing to
|
||||
/// override then.
|
||||
/// </remarks>
|
||||
public bool AllowUserOverride { get; init; }
|
||||
public bool AllowUserOverride { get; set; }
|
||||
}
|
||||
@@ -12,20 +12,20 @@ public sealed record DataDocumentAnalysisPolicy : ConfigurationBaseObject
|
||||
private static readonly ILogger LOG = Program.LOGGER_FACTORY.CreateLogger<DataDocumentAnalysisPolicy>();
|
||||
|
||||
/// <inheritdoc />
|
||||
public override string Id { get; init; } = string.Empty;
|
||||
public override string Id { get; set; } = string.Empty;
|
||||
|
||||
/// <inheritdoc />
|
||||
public override uint Num { get; init; }
|
||||
public override uint Num { get; set; }
|
||||
|
||||
/// <inheritdoc />
|
||||
public override string Name
|
||||
{
|
||||
get => this.PolicyName;
|
||||
init => this.PolicyName = value;
|
||||
set => this.PolicyName = value;
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public override bool IsEnterpriseConfiguration { get; init; }
|
||||
public override bool IsEnterpriseConfiguration { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The name of the document analysis policy.
|
||||
@@ -43,7 +43,7 @@ public sealed record DataDocumentAnalysisPolicy : ConfigurationBaseObject
|
||||
public bool IsProtected { get; set; }
|
||||
|
||||
/// <inheritdoc />
|
||||
public override Guid EnterpriseConfigurationPluginId { get; init; } = Guid.Empty;
|
||||
public override Guid EnterpriseConfigurationPluginId { get; set; } = Guid.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// The rules for the document analysis policy.
|
||||
|
||||
@@ -5,25 +5,25 @@ public sealed record DataMandatoryInfoAcceptance
|
||||
/// <summary>
|
||||
/// The ID of the mandatory info that was accepted.
|
||||
/// </summary>
|
||||
public string InfoId { get; init; } = string.Empty;
|
||||
public string InfoId { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// The accepted version string.
|
||||
/// </summary>
|
||||
public string AcceptedVersion { get; init; } = string.Empty;
|
||||
public string AcceptedVersion { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// The accepted hash of the mandatory info content.
|
||||
/// </summary>
|
||||
public string AcceptedHash { get; init; } = string.Empty;
|
||||
public string AcceptedHash { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// The UTC time of the acceptance.
|
||||
/// </summary>
|
||||
public DateTimeOffset AcceptedAtUtc { get; init; }
|
||||
public DateTimeOffset AcceptedAtUtc { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The plugin that provided the accepted info at the time of acceptance.
|
||||
/// </summary>
|
||||
public Guid EnterpriseConfigurationPluginId { get; init; } = Guid.Empty;
|
||||
public Guid EnterpriseConfigurationPluginId { get; set; } = Guid.Empty;
|
||||
}
|
||||
@@ -20,7 +20,7 @@ namespace AIStudio.Settings.DataModel;
|
||||
/// <summary>
|
||||
/// An external data source, accessed via an ERI server, cf. https://github.com/MindWorkAI/ERI.
|
||||
/// </summary>
|
||||
public readonly record struct DataSourceERI_V1 : IERIDataSource
|
||||
public record struct DataSourceERI_V1: IERIDataSource
|
||||
{
|
||||
private static readonly ILogger<DataSourceERI_V1> LOGGER = Program.LOGGER_FACTORY.CreateLogger<DataSourceERI_V1>();
|
||||
|
||||
@@ -34,52 +34,52 @@ public readonly record struct DataSourceERI_V1 : IERIDataSource
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public uint Num { get; init; }
|
||||
public uint Num { get; set; }
|
||||
|
||||
/// <inheritdoc />
|
||||
public string Id { get; init; } = Guid.Empty.ToString();
|
||||
public string Id { get; set; } = Guid.Empty.ToString();
|
||||
|
||||
/// <inheritdoc />
|
||||
public string Name { get; init; } = string.Empty;
|
||||
public string Name { get; set; } = string.Empty;
|
||||
|
||||
/// <inheritdoc />
|
||||
public DataSourceType Type { get; init; } = DataSourceType.NONE;
|
||||
public DataSourceType Type { get; set; } = DataSourceType.NONE;
|
||||
|
||||
/// <inheritdoc />
|
||||
public string Hostname { get; init; } = string.Empty;
|
||||
public string Hostname { get; set; } = string.Empty;
|
||||
|
||||
/// <inheritdoc />
|
||||
public int Port { get; init; }
|
||||
public int Port { get; set; }
|
||||
|
||||
/// <inheritdoc />
|
||||
public AuthMethod AuthMethod { get; init; } = AuthMethod.NONE;
|
||||
public AuthMethod AuthMethod { get; set; } = AuthMethod.NONE;
|
||||
|
||||
/// <inheritdoc />
|
||||
public string Username { get; init; } = string.Empty;
|
||||
public string Username { get; set; } = string.Empty;
|
||||
|
||||
/// <inheritdoc />
|
||||
public DataSourceERIUsernamePasswordMode UsernamePasswordMode { get; init; } = DataSourceERIUsernamePasswordMode.USER_MANAGED;
|
||||
public DataSourceERIUsernamePasswordMode UsernamePasswordMode { get; set; } = DataSourceERIUsernamePasswordMode.USER_MANAGED;
|
||||
|
||||
/// <inheritdoc />
|
||||
public DataSourceSecurity SecurityPolicy { get; init; } = DataSourceSecurity.NOT_SPECIFIED;
|
||||
public DataSourceSecurity SecurityPolicy { get; set; } = DataSourceSecurity.NOT_SPECIFIED;
|
||||
|
||||
/// <inheritdoc />
|
||||
public OutboundDataRestriction OutboundDataRestriction { get; init; } = DataSourceOutboundDataExtensions.DEFAULT_OUTBOUND_DATA_RESTRICTION;
|
||||
public OutboundDataRestriction OutboundDataRestriction { get; set; } = DataSourceOutboundDataExtensions.DEFAULT_OUTBOUND_DATA_RESTRICTION;
|
||||
|
||||
/// <inheritdoc />
|
||||
public bool IsEnterpriseConfiguration { get; init; }
|
||||
public bool IsEnterpriseConfiguration { get; set; }
|
||||
|
||||
/// <inheritdoc />
|
||||
public Guid EnterpriseConfigurationPluginId { get; init; } = Guid.Empty;
|
||||
public Guid EnterpriseConfigurationPluginId { get; set; } = Guid.Empty;
|
||||
|
||||
/// <inheritdoc />
|
||||
public ERIVersion Version { get; init; } = ERIVersion.V1;
|
||||
public ERIVersion Version { get; set; } = ERIVersion.V1;
|
||||
|
||||
/// <inheritdoc />
|
||||
public string SelectedRetrievalId { get; init; } = string.Empty;
|
||||
public string SelectedRetrievalId { get; set; } = string.Empty;
|
||||
|
||||
/// <inheritdoc />
|
||||
public ushort MaxMatches { get; init; } = 10;
|
||||
public ushort MaxMatches { get; set; } = 10;
|
||||
|
||||
/// <inheritdoc />
|
||||
public async Task<IReadOnlyList<IRetrievalContext>> RetrieveDataAsync(IContent lastUserPrompt, ChatThread thread, CancellationToken token = default)
|
||||
|
||||
@@ -10,7 +10,7 @@ namespace AIStudio.Settings.DataModel;
|
||||
/// <summary>
|
||||
/// Represents a local directory as a data source.
|
||||
/// </summary>
|
||||
public readonly record struct DataSourceLocalDirectory : IInternalDataSource
|
||||
public record struct DataSourceLocalDirectory: IInternalDataSource
|
||||
{
|
||||
// Selects what folder data sources indexed before they had file patterns, plus every other
|
||||
// file whose content is readable text, e.g., a Terraform file or a script without an extension.
|
||||
@@ -27,46 +27,46 @@ public readonly record struct DataSourceLocalDirectory : IInternalDataSource
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public uint Num { get; init; }
|
||||
public uint Num { get; set; }
|
||||
|
||||
/// <inheritdoc />
|
||||
public string Id { get; init; } = Guid.Empty.ToString();
|
||||
public string Id { get; set; } = Guid.Empty.ToString();
|
||||
|
||||
/// <inheritdoc />
|
||||
public string Name { get; init; } = string.Empty;
|
||||
public string Name { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// The description of the data source. What kind of data does it contain?
|
||||
/// What is the data source used for?
|
||||
/// </summary>
|
||||
public string Description { get; init; } = string.Empty;
|
||||
public string Description { get; set; } = string.Empty;
|
||||
|
||||
/// <inheritdoc />
|
||||
public DataSourceType Type { get; init; } = DataSourceType.NONE;
|
||||
public DataSourceType Type { get; set; } = DataSourceType.NONE;
|
||||
|
||||
/// <inheritdoc />
|
||||
public string EmbeddingId { get; init; } = Guid.Empty.ToString();
|
||||
public string EmbeddingId { get; set; } = Guid.Empty.ToString();
|
||||
|
||||
/// <inheritdoc />
|
||||
public int MaxChunkTokenLength { get; init; }
|
||||
public int MaxChunkTokenLength { get; set; }
|
||||
|
||||
/// <inheritdoc />
|
||||
public int ChunkOverlapTokenLength { get; init; } = DataSourceEmbeddingService.DEFAULT_CHUNK_OVERLAP_TOKEN_LENGTH;
|
||||
public int ChunkOverlapTokenLength { get; set; } = DataSourceEmbeddingService.DEFAULT_CHUNK_OVERLAP_TOKEN_LENGTH;
|
||||
|
||||
/// <inheritdoc />
|
||||
public ConfidenceLevel ConfidenceLevel { get; init; } = ConfidenceLevel.UNKNOWN;
|
||||
public ConfidenceLevel ConfidenceLevel { get; set; } = ConfidenceLevel.UNKNOWN;
|
||||
|
||||
/// <inheritdoc />
|
||||
public bool IsEnterpriseConfiguration { get; init; }
|
||||
public bool IsEnterpriseConfiguration { get; set; }
|
||||
|
||||
/// <inheritdoc />
|
||||
public Guid EnterpriseConfigurationPluginId { get; init; } = Guid.Empty;
|
||||
public Guid EnterpriseConfigurationPluginId { get; set; } = Guid.Empty;
|
||||
|
||||
/// <inheritdoc />
|
||||
public ushort MaxMatches { get; init; } = 10;
|
||||
public ushort MaxMatches { get; set; } = 10;
|
||||
|
||||
/// <inheritdoc />
|
||||
public OutboundDataRestriction OutboundDataRestriction { get; init; } = DataSourceOutboundDataExtensions.DEFAULT_OUTBOUND_DATA_RESTRICTION;
|
||||
public OutboundDataRestriction OutboundDataRestriction { get; set; } = DataSourceOutboundDataExtensions.DEFAULT_OUTBOUND_DATA_RESTRICTION;
|
||||
|
||||
/// <inheritdoc />
|
||||
public Task<IReadOnlyList<IRetrievalContext>> RetrieveDataAsync(IContent lastUserPrompt, ChatThread thread, CancellationToken token = default) =>
|
||||
@@ -79,31 +79,31 @@ public readonly record struct DataSourceLocalDirectory : IInternalDataSource
|
||||
/// <summary>
|
||||
/// The path to the directory.
|
||||
/// </summary>
|
||||
public string Path { get; init; } = string.Empty;
|
||||
public string Path { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// Semicolon-separated file-name patterns which decide which files below the path
|
||||
/// are considered for indexing.
|
||||
/// </summary>
|
||||
public string FilePatterns { get; init; } = DEFAULT_FILE_PATTERNS;
|
||||
public string FilePatterns { get; set; } = DEFAULT_FILE_PATTERNS;
|
||||
|
||||
/// <summary>
|
||||
/// The files and folders below the path which are left out, even when a file pattern selects
|
||||
/// them, cf. FileExclusions. Data sources from before this list existed get the default list,
|
||||
/// so their build outputs and dependencies leave the index during the next run.
|
||||
/// </summary>
|
||||
public string ExcludePatterns { get; init; } = FileExclusions.DEFAULT_PATTERNS;
|
||||
public string ExcludePatterns { get; set; } = FileExclusions.DEFAULT_PATTERNS;
|
||||
|
||||
/// <summary>
|
||||
/// The largest file below the path which is indexed, in megabytes. A larger file which the
|
||||
/// patterns select is not indexed, and the embedding page tells the user about it.
|
||||
/// </summary>
|
||||
public int MaxFileSizeMegabytes { get; init; } = FolderFileSelection.DEFAULT_MAX_FILE_SIZE_MEGABYTES;
|
||||
public int MaxFileSizeMegabytes { get; set; } = FolderFileSelection.DEFAULT_MAX_FILE_SIZE_MEGABYTES;
|
||||
|
||||
/// <summary>
|
||||
/// Whether files in folders below the path are considered for indexing.
|
||||
/// </summary>
|
||||
public bool IncludeSubdirectories { get; init; } = DEFAULT_INCLUDE_SUBDIRECTORIES;
|
||||
public bool IncludeSubdirectories { get; set; } = DEFAULT_INCLUDE_SUBDIRECTORIES;
|
||||
|
||||
/// <summary>
|
||||
/// Whether hidden files and the files in hidden folders below the path are considered for
|
||||
@@ -114,7 +114,7 @@ public readonly record struct DataSourceLocalDirectory : IInternalDataSource
|
||||
/// the hidden files it names, cf. FileNamePatterns.NamesHiddenFile. Hidden folders are entered
|
||||
/// only while this is on.
|
||||
/// </remarks>
|
||||
public bool IncludeHiddenFilesAndFolders { get; init; } = DEFAULT_INCLUDE_HIDDEN_FILES_AND_FOLDERS;
|
||||
public bool IncludeHiddenFilesAndFolders { get; set; } = DEFAULT_INCLUDE_HIDDEN_FILES_AND_FOLDERS;
|
||||
|
||||
/// <summary>
|
||||
/// The patterns used at runtime. An invalid value can only come from malformed or hand-edited
|
||||
|
||||
@@ -8,53 +8,53 @@ namespace AIStudio.Settings.DataModel;
|
||||
/// <summary>
|
||||
/// Represents one local file as a data source.
|
||||
/// </summary>
|
||||
public readonly record struct DataSourceLocalFile : IInternalDataSource
|
||||
public record struct DataSourceLocalFile: IInternalDataSource
|
||||
{
|
||||
public DataSourceLocalFile()
|
||||
{
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public uint Num { get; init; }
|
||||
public uint Num { get; set; }
|
||||
|
||||
/// <inheritdoc />
|
||||
public string Id { get; init; } = Guid.Empty.ToString();
|
||||
public string Id { get; set; } = Guid.Empty.ToString();
|
||||
|
||||
/// <inheritdoc />
|
||||
public string Name { get; init; } = string.Empty;
|
||||
public string Name { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// The description of the data source. What kind of data does it contain?
|
||||
/// What is the data source used for?
|
||||
/// </summary>
|
||||
public string Description { get; init; } = string.Empty;
|
||||
public string Description { get; set; } = string.Empty;
|
||||
|
||||
/// <inheritdoc />
|
||||
public DataSourceType Type { get; init; } = DataSourceType.NONE;
|
||||
public DataSourceType Type { get; set; } = DataSourceType.NONE;
|
||||
|
||||
/// <inheritdoc />
|
||||
public string EmbeddingId { get; init; } = Guid.Empty.ToString();
|
||||
public string EmbeddingId { get; set; } = Guid.Empty.ToString();
|
||||
|
||||
/// <inheritdoc />
|
||||
public int MaxChunkTokenLength { get; init; }
|
||||
public int MaxChunkTokenLength { get; set; }
|
||||
|
||||
/// <inheritdoc />
|
||||
public int ChunkOverlapTokenLength { get; init; } = DataSourceEmbeddingService.DEFAULT_CHUNK_OVERLAP_TOKEN_LENGTH;
|
||||
public int ChunkOverlapTokenLength { get; set; } = DataSourceEmbeddingService.DEFAULT_CHUNK_OVERLAP_TOKEN_LENGTH;
|
||||
|
||||
/// <inheritdoc />
|
||||
public ConfidenceLevel ConfidenceLevel { get; init; } = ConfidenceLevel.UNKNOWN;
|
||||
public ConfidenceLevel ConfidenceLevel { get; set; } = ConfidenceLevel.UNKNOWN;
|
||||
|
||||
/// <inheritdoc />
|
||||
public bool IsEnterpriseConfiguration { get; init; }
|
||||
public bool IsEnterpriseConfiguration { get; set; }
|
||||
|
||||
/// <inheritdoc />
|
||||
public Guid EnterpriseConfigurationPluginId { get; init; } = Guid.Empty;
|
||||
public Guid EnterpriseConfigurationPluginId { get; set; } = Guid.Empty;
|
||||
|
||||
/// <inheritdoc />
|
||||
public ushort MaxMatches { get; init; } = 10;
|
||||
public ushort MaxMatches { get; set; } = 10;
|
||||
|
||||
/// <inheritdoc />
|
||||
public OutboundDataRestriction OutboundDataRestriction { get; init; } = DataSourceOutboundDataExtensions.DEFAULT_OUTBOUND_DATA_RESTRICTION;
|
||||
public OutboundDataRestriction OutboundDataRestriction { get; set; } = DataSourceOutboundDataExtensions.DEFAULT_OUTBOUND_DATA_RESTRICTION;
|
||||
|
||||
/// <inheritdoc />
|
||||
public Task<IReadOnlyList<IRetrievalContext>> RetrieveDataAsync(IContent lastUserPrompt, ChatThread thread, CancellationToken token = default) =>
|
||||
@@ -67,5 +67,5 @@ public readonly record struct DataSourceLocalFile : IInternalDataSource
|
||||
/// <summary>
|
||||
/// The path to the file.
|
||||
/// </summary>
|
||||
public string FilePath { get; init; } = string.Empty;
|
||||
public string FilePath { get; set; } = string.Empty;
|
||||
}
|
||||
@@ -13,70 +13,70 @@ namespace AIStudio.Settings.DataModel;
|
||||
/// IDataSource: classic RAG, Semantic Search and the agents never see a mailbox. Only the mail
|
||||
/// tools read from one.
|
||||
/// </remarks>
|
||||
public readonly record struct DataSourceMailbox : IIndexedDataSource, ISecretId
|
||||
public record struct DataSourceMailbox: IIndexedDataSource, ISecretId
|
||||
{
|
||||
public DataSourceMailbox()
|
||||
{
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public uint Num { get; init; }
|
||||
public uint Num { get; set; }
|
||||
|
||||
/// <inheritdoc />
|
||||
public string Id { get; init; } = Guid.Empty.ToString();
|
||||
public string Id { get; set; } = Guid.Empty.ToString();
|
||||
|
||||
/// <inheritdoc />
|
||||
public string Name { get; init; } = string.Empty;
|
||||
public string Name { get; set; } = string.Empty;
|
||||
|
||||
/// <inheritdoc />
|
||||
public DataSourceType Type { get; init; } = DataSourceType.MAILBOX;
|
||||
public DataSourceType Type { get; set; } = DataSourceType.MAILBOX;
|
||||
|
||||
/// <inheritdoc />
|
||||
public bool IsEnterpriseConfiguration { get; init; }
|
||||
public bool IsEnterpriseConfiguration { get; set; }
|
||||
|
||||
/// <inheritdoc />
|
||||
public Guid EnterpriseConfigurationPluginId { get; init; } = Guid.Empty;
|
||||
public Guid EnterpriseConfigurationPluginId { get; set; } = Guid.Empty;
|
||||
|
||||
/// <inheritdoc />
|
||||
public string EmbeddingId { get; init; } = Guid.Empty.ToString();
|
||||
public string EmbeddingId { get; set; } = Guid.Empty.ToString();
|
||||
|
||||
/// <inheritdoc />
|
||||
public int MaxChunkTokenLength { get; init; }
|
||||
public int MaxChunkTokenLength { get; set; }
|
||||
|
||||
/// <inheritdoc />
|
||||
public int ChunkOverlapTokenLength { get; init; } = DataSourceEmbeddingService.DEFAULT_CHUNK_OVERLAP_TOKEN_LENGTH;
|
||||
public int ChunkOverlapTokenLength { get; set; } = DataSourceEmbeddingService.DEFAULT_CHUNK_OVERLAP_TOKEN_LENGTH;
|
||||
|
||||
/// <inheritdoc />
|
||||
/// <remarks>
|
||||
/// There is no default, the user has to choose one of the levels which IsAllowedMailboxConfidence
|
||||
/// accepts. Until then, the level is NONE, and no provider may read the mailbox.
|
||||
/// </remarks>
|
||||
public ConfidenceLevel ConfidenceLevel { get; init; } = ConfidenceLevel.NONE;
|
||||
public ConfidenceLevel ConfidenceLevel { get; set; } = ConfidenceLevel.NONE;
|
||||
|
||||
/// <summary>
|
||||
/// The host name of the IMAP server, e.g., imap.example.org.
|
||||
/// </summary>
|
||||
public string Host { get; init; } = string.Empty;
|
||||
public string Host { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// The port of the IMAP server. The default is the one for IMAP with TLS from the first byte on.
|
||||
/// </summary>
|
||||
public int Port { get; init; } = MailboxTransportSecurityExtensions.SSL_ON_CONNECT_PORT;
|
||||
public int Port { get; set; } = MailboxTransportSecurityExtensions.SSL_ON_CONNECT_PORT;
|
||||
|
||||
/// <summary>
|
||||
/// How the connection to the IMAP server is encrypted.
|
||||
/// </summary>
|
||||
public MailboxTransportSecurity TransportSecurity { get; init; } = MailboxTransportSecurity.SSL_ON_CONNECT;
|
||||
public MailboxTransportSecurity TransportSecurity { get; set; } = MailboxTransportSecurity.SSL_ON_CONNECT;
|
||||
|
||||
/// <summary>
|
||||
/// How AI Studio signs in to the IMAP server.
|
||||
/// </summary>
|
||||
public MailboxAuthMethod AuthMethod { get; init; } = MailboxAuthMethod.PASSWORD;
|
||||
public MailboxAuthMethod AuthMethod { get; set; } = MailboxAuthMethod.PASSWORD;
|
||||
|
||||
/// <summary>
|
||||
/// The username to sign in with, often the e-mail address.
|
||||
/// </summary>
|
||||
public string Username { get; init; } = string.Empty;
|
||||
public string Username { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// The folder to which the synchronization and all mail tools are restricted, together with its subfolders.
|
||||
@@ -86,7 +86,7 @@ public readonly record struct DataSourceMailbox : IIndexedDataSource, ISecretId
|
||||
/// means the whole mailbox, apart from the trash and the junk folder. The sent mails and the
|
||||
/// drafts may come along from outside of it, see IncludeSentAndDrafts.
|
||||
/// </remarks>
|
||||
public string RootFolder { get; init; } = string.Empty;
|
||||
public string RootFolder { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// Whether the folders for sent mails and for drafts are synchronized as well, when they lie outside the root folder.
|
||||
@@ -96,22 +96,22 @@ public readonly record struct DataSourceMailbox : IIndexedDataSource, ISecretId
|
||||
/// marks as such count, without their subfolders. A mailbox stored before this setting existed
|
||||
/// loads with it switched on, so that its next sync fetches them.
|
||||
/// </remarks>
|
||||
public bool IncludeSentAndDrafts { get; init; } = true;
|
||||
public bool IncludeSentAndDrafts { get; set; } = true;
|
||||
|
||||
/// <summary>
|
||||
/// How far back the index reaches. Flagged mails and drafts are indexed regardless of their age.
|
||||
/// </summary>
|
||||
public MailboxMaxAge MaxAge { get; init; } = MailboxMaxAge.LAST_12_MONTHS;
|
||||
public MailboxMaxAge MaxAge { get; set; } = MailboxMaxAge.LAST_12_MONTHS;
|
||||
|
||||
/// <summary>
|
||||
/// Whether the text of attached documents is indexed as well.
|
||||
/// </summary>
|
||||
public bool IndexAttachments { get; init; } = true;
|
||||
public bool IndexAttachments { get; set; } = true;
|
||||
|
||||
/// <summary>
|
||||
/// The size in megabytes up to which the text of an attachment is indexed. Of a larger one, only the name is.
|
||||
/// </summary>
|
||||
public int MaxAttachmentSizeMegabytes { get; init; } = 10;
|
||||
public int MaxAttachmentSizeMegabytes { get; set; } = 10;
|
||||
|
||||
/// <summary>
|
||||
/// Where a chat may still send data, once it has read from this mailbox.
|
||||
@@ -119,12 +119,12 @@ public readonly record struct DataSourceMailbox : IIndexedDataSource, ISecretId
|
||||
/// <remarks>
|
||||
/// An organization may demand a stricter one, see DataMailboxes.MinimumOutboundDataRestriction.
|
||||
/// </remarks>
|
||||
public OutboundDataRestriction OutboundDataRestriction { get; init; } = OutboundDataRestriction.ONLY_CONFIGURED_SERVICES;
|
||||
public OutboundDataRestriction OutboundDataRestriction { get; set; } = OutboundDataRestriction.ONLY_CONFIGURED_SERVICES;
|
||||
|
||||
/// <summary>
|
||||
/// The maximum number of mails one search returns. Searched page by page, it is the size of a page.
|
||||
/// </summary>
|
||||
public ushort MaxMatches { get; init; } = 10;
|
||||
public ushort MaxMatches { get; set; } = 10;
|
||||
|
||||
#region Implementation of ISecretId
|
||||
|
||||
|
||||
@@ -13,12 +13,12 @@ public sealed class DataV1V3
|
||||
/// The version of the settings file. Allows us to upgrade the settings
|
||||
/// when a new version is available.
|
||||
/// </summary>
|
||||
public Version Version { get; init; } = Version.V3;
|
||||
public Version Version { get; set; } = Version.V3;
|
||||
|
||||
/// <summary>
|
||||
/// List of configured providers.
|
||||
/// </summary>
|
||||
public List<Provider> Providers { get; init; } = [];
|
||||
public List<Provider> Providers { get; set; } = [];
|
||||
|
||||
/// <summary>
|
||||
/// The next provider number to use.
|
||||
|
||||
@@ -6,22 +6,22 @@ public sealed class DataV4
|
||||
/// The version of the settings file. Allows us to upgrade the settings
|
||||
/// when a new version is available.
|
||||
/// </summary>
|
||||
public Version Version { get; init; }
|
||||
public Version Version { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// List of configured providers.
|
||||
/// </summary>
|
||||
public List<Provider> Providers { get; init; } = [];
|
||||
public List<Provider> Providers { get; set; } = [];
|
||||
|
||||
/// <summary>
|
||||
/// Settings concerning the LLM providers.
|
||||
/// </summary>
|
||||
public DataLLMProvidersV5 LLMProviders { get; init; } = new();
|
||||
public DataLLMProvidersV5 LLMProviders { get; set; } = new();
|
||||
|
||||
/// <summary>
|
||||
/// List of configured profiles.
|
||||
/// </summary>
|
||||
public List<Profile> Profiles { get; init; } = [];
|
||||
public List<Profile> Profiles { get; set; } = [];
|
||||
|
||||
/// <summary>
|
||||
/// The next provider number to use.
|
||||
@@ -33,27 +33,27 @@ public sealed class DataV4
|
||||
/// </summary>
|
||||
public uint NextProfileNum { get; set; } = 1;
|
||||
|
||||
public DataApp App { get; init; } = new(x => x.App);
|
||||
public DataApp App { get; set; } = new(x => x.App);
|
||||
|
||||
public DataChat Chat { get; init; } = new();
|
||||
public DataChat Chat { get; set; } = new();
|
||||
|
||||
public DataWorkspace Workspace { get; init; } = new();
|
||||
public DataWorkspace Workspace { get; set; } = new();
|
||||
|
||||
public DataIconFinder IconFinder { get; init; } = new();
|
||||
public DataIconFinder IconFinder { get; set; } = new();
|
||||
|
||||
public DataTranslation Translation { get; init; } = new();
|
||||
public DataTranslation Translation { get; set; } = new();
|
||||
|
||||
public DataCoding Coding { get; init; } = new();
|
||||
public DataCoding Coding { get; set; } = new();
|
||||
|
||||
public DataTextSummarizer TextSummarizer { get; init; } = new();
|
||||
public DataTextSummarizer TextSummarizer { get; set; } = new();
|
||||
|
||||
public DataTextContentCleaner TextContentCleaner { get; init; } = new();
|
||||
public DataTextContentCleaner TextContentCleaner { get; set; } = new();
|
||||
|
||||
public DataAgenda Agenda { get; init; } = new();
|
||||
public DataAgenda Agenda { get; set; } = new();
|
||||
|
||||
public DataGrammarSpelling GrammarSpelling { get; init; } = new();
|
||||
public DataGrammarSpelling GrammarSpelling { get; set; } = new();
|
||||
|
||||
public DataRewriteImprove RewriteImprove { get; init; } = new();
|
||||
public DataRewriteImprove RewriteImprove { get; set; } = new();
|
||||
|
||||
public DataEMail EMail { get; set; } = new();
|
||||
|
||||
|
||||
@@ -8,27 +8,27 @@ public sealed class DataV5
|
||||
/// The version of the settings file. Allows us to upgrade the settings
|
||||
/// when a new version is available.
|
||||
/// </summary>
|
||||
public Version Version { get; init; } = Version.V5;
|
||||
public Version Version { get; set; } = Version.V5;
|
||||
|
||||
/// <summary>
|
||||
/// List of configured providers.
|
||||
/// </summary>
|
||||
public List<AIStudio.Settings.Provider> Providers { get; init; } = [];
|
||||
public List<AIStudio.Settings.Provider> Providers { get; set; } = [];
|
||||
|
||||
/// <summary>
|
||||
/// Settings concerning the LLM providers.
|
||||
/// </summary>
|
||||
public DataLLMProvidersV5 LLMProviders { get; init; } = new();
|
||||
public DataLLMProvidersV5 LLMProviders { get; set; } = new();
|
||||
|
||||
/// <summary>
|
||||
/// A collection of embedding providers configured.
|
||||
/// </summary>
|
||||
public List<EmbeddingProvider> EmbeddingProviders { get; init; } = [];
|
||||
public List<EmbeddingProvider> EmbeddingProviders { get; set; } = [];
|
||||
|
||||
/// <summary>
|
||||
/// A collection of speech providers configured.
|
||||
/// </summary>
|
||||
public List<TranscriptionProvider> TranscriptionProviders { get; init; } = [];
|
||||
public List<TranscriptionProvider> TranscriptionProviders { get; set; } = [];
|
||||
|
||||
/// <summary>
|
||||
/// A collection of data sources configured.
|
||||
@@ -38,12 +38,12 @@ public sealed class DataV5
|
||||
/// <summary>
|
||||
/// List of configured profiles.
|
||||
/// </summary>
|
||||
public List<Profile> Profiles { get; init; } = [];
|
||||
public List<Profile> Profiles { get; set; } = [];
|
||||
|
||||
/// <summary>
|
||||
/// List of configured chat templates.
|
||||
/// </summary>
|
||||
public List<ChatTemplate> ChatTemplates { get; init; } = [];
|
||||
public List<ChatTemplate> ChatTemplates { get; set; } = [];
|
||||
|
||||
/// <summary>
|
||||
/// List of enabled plugins.
|
||||
@@ -95,55 +95,55 @@ public sealed class DataV5
|
||||
/// </summary>
|
||||
public uint NextDocumentAnalysisPolicyNum { get; set; } = 1;
|
||||
|
||||
public DataApp App { get; init; } = new(x => x.App);
|
||||
public DataApp App { get; set; } = new(x => x.App);
|
||||
|
||||
public DataChat Chat { get; init; } = new();
|
||||
public DataChat Chat { get; set; } = new();
|
||||
|
||||
public DataWorkspace Workspace { get; init; } = new();
|
||||
public DataWorkspace Workspace { get; set; } = new();
|
||||
|
||||
public DataIconFinder IconFinder { get; init; } = new();
|
||||
public DataIconFinder IconFinder { get; set; } = new();
|
||||
|
||||
public DataTranslation Translation { get; init; } = new();
|
||||
public DataTranslation Translation { get; set; } = new();
|
||||
|
||||
public DataCoding Coding { get; init; } = new();
|
||||
public DataCoding Coding { get; set; } = new();
|
||||
|
||||
public DataERI ERI { get; init; } = new();
|
||||
public DataERI ERI { get; set; } = new();
|
||||
|
||||
public DataDocumentAnalysis DocumentAnalysis { get; init; } = new();
|
||||
public DataDocumentAnalysis DocumentAnalysis { get; set; } = new();
|
||||
|
||||
public DataMandatoryInformation MandatoryInformation { get; init; } = new();
|
||||
public DataMandatoryInformation MandatoryInformation { get; set; } = new();
|
||||
|
||||
public DataTextSummarizer TextSummarizer { get; init; } = new();
|
||||
public DataTextSummarizer TextSummarizer { get; set; } = new();
|
||||
|
||||
public DataTextContentCleaner TextContentCleaner { get; init; } = new();
|
||||
public DataTextContentCleaner TextContentCleaner { get; set; } = new();
|
||||
|
||||
public DataAgentDataSourceSelection AgentDataSourceSelection { get; init; } = new();
|
||||
public DataAgentDataSourceSelection AgentDataSourceSelection { get; set; } = new();
|
||||
|
||||
public DataAgentRetrievalContextValidation AgentRetrievalContextValidation { get; init; } = new();
|
||||
public DataAgentRetrievalContextValidation AgentRetrievalContextValidation { get; set; } = new();
|
||||
|
||||
public DataAssistantPluginAudit AssistantPluginAudit { get; init; } = new(x => x.AssistantPluginAudit);
|
||||
public DataAssistantPluginAudit AssistantPluginAudit { get; set; } = new(x => x.AssistantPluginAudit);
|
||||
|
||||
public DataAgenda Agenda { get; init; } = new();
|
||||
public DataAgenda Agenda { get; set; } = new();
|
||||
|
||||
public DataGrammarSpelling GrammarSpelling { get; init; } = new();
|
||||
public DataGrammarSpelling GrammarSpelling { get; set; } = new();
|
||||
|
||||
public DataRewriteImprove RewriteImprove { get; init; } = new();
|
||||
public DataRewriteImprove RewriteImprove { get; set; } = new();
|
||||
|
||||
public DataPromptOptimizer PromptOptimizer { get; init; } = new();
|
||||
public DataPromptOptimizer PromptOptimizer { get; set; } = new();
|
||||
|
||||
public DataEMail EMail { get; init; } = new();
|
||||
public DataEMail EMail { get; set; } = new();
|
||||
|
||||
public DataSlideBuilder SlideBuilder { get; init; } = new();
|
||||
public DataSlideBuilder SlideBuilder { get; set; } = new();
|
||||
|
||||
public DataLegalCheck LegalCheck { get; init; } = new();
|
||||
public DataLegalCheck LegalCheck { get; set; } = new();
|
||||
|
||||
public DataSynonyms Synonyms { get; init; } = new();
|
||||
public DataSynonyms Synonyms { get; set; } = new();
|
||||
|
||||
public DataMyTasks MyTasks { get; init; } = new();
|
||||
public DataMyTasks MyTasks { get; set; } = new();
|
||||
|
||||
public DataJobPostings JobPostings { get; init; } = new();
|
||||
public DataJobPostings JobPostings { get; set; } = new();
|
||||
|
||||
public DataBiasOfTheDay BiasOfTheDay { get; init; } = new();
|
||||
public DataBiasOfTheDay BiasOfTheDay { get; set; } = new();
|
||||
|
||||
public DataI18N I18N { get; init; } = new();
|
||||
public DataI18N I18N { get; set; } = new();
|
||||
}
|
||||
@@ -23,7 +23,7 @@ public sealed record EmbeddingProvider(
|
||||
Guid EnterpriseConfigurationPluginId = default,
|
||||
string Hostname = "http://localhost:1234",
|
||||
Host Host = Host.NONE,
|
||||
[property: JsonConverter(typeof(DataDirectoryRelativePathConverter))] string TokenizerPath = "",
|
||||
string TokenizerPath = "",
|
||||
string TokenizerFingerprint = "",
|
||||
int EmbeddingBatchSize = 0,
|
||||
int TokenLimit = 0,
|
||||
@@ -32,6 +32,34 @@ public sealed record EmbeddingProvider(
|
||||
HFInferenceProvider HFInferenceProvider = HFInferenceProvider.NONE,
|
||||
bool PromptForUserAPIKey = false) : ConfigurationBaseObject, ISecretId, IUserProvidedAPIKey
|
||||
{
|
||||
//
|
||||
// The properties of the parameters, declared again to be settable. The source generation of System.Text.Json
|
||||
// sets every init-only property while it creates the object, also one missing in the JSON, so its value from
|
||||
// the parameterless constructor would get lost. Keep them first and in the order of the parameters, which is
|
||||
// the order they get stored in:
|
||||
//
|
||||
public override uint Num { get; set; } = Num;
|
||||
public override string Id { get; set; } = Id;
|
||||
public override string Name { get; set; } = Name;
|
||||
public LLMProviders UsedLLMProvider { get; set; } = UsedLLMProvider;
|
||||
public Model Model { get; set; } = Model;
|
||||
public bool IsSelfHosted { get; set; } = IsSelfHosted;
|
||||
public override bool IsEnterpriseConfiguration { get; set; } = IsEnterpriseConfiguration;
|
||||
public override Guid EnterpriseConfigurationPluginId { get; set; } = EnterpriseConfigurationPluginId;
|
||||
public string Hostname { get; set; } = Hostname;
|
||||
public Host Host { get; set; } = Host;
|
||||
|
||||
[JsonConverter(typeof(DataDirectoryRelativePathConverter))]
|
||||
public string TokenizerPath { get; set; } = TokenizerPath;
|
||||
|
||||
public string TokenizerFingerprint { get; set; } = TokenizerFingerprint;
|
||||
public int EmbeddingBatchSize { get; set; } = EmbeddingBatchSize;
|
||||
public int TokenLimit { get; set; } = TokenLimit;
|
||||
public bool AllowUserProvidedAPIKey { get; set; } = AllowUserProvidedAPIKey;
|
||||
public string CustomIconDataUrl { get; set; } = CustomIconDataUrl;
|
||||
public HFInferenceProvider HFInferenceProvider { get; set; } = HFInferenceProvider;
|
||||
public bool PromptForUserAPIKey { get; set; } = PromptForUserAPIKey;
|
||||
|
||||
public const int DEFAULT_TOKEN_LIMIT = 8192;
|
||||
public const int DEFAULT_EMBEDDING_BATCH_SIZE = 1;
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@ public interface IDataSource : IDataSourceBase
|
||||
/// <summary>
|
||||
/// The maximum number of matches one retrieval returns. Searched page by page, it is the size of a page.
|
||||
/// </summary>
|
||||
public ushort MaxMatches { get; init; }
|
||||
public ushort MaxMatches { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Where a chat may still send data, once content of this data source reached it.
|
||||
@@ -29,7 +29,7 @@ public interface IDataSource : IDataSourceBase
|
||||
/// DataSourceSecuritySettings.MinimumOutboundDataRestriction, and so does a data source which only
|
||||
/// self-hosted providers may see.
|
||||
/// </remarks>
|
||||
public OutboundDataRestriction OutboundDataRestriction { get; init; }
|
||||
public OutboundDataRestriction OutboundDataRestriction { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The last page which can be retrieved from this data source.
|
||||
|
||||
@@ -17,5 +17,5 @@ public interface IDataSourceBase : IConfigurationObject
|
||||
/// <summary>
|
||||
/// Which type of data source is this?
|
||||
/// </summary>
|
||||
public DataSourceType Type { get; init; }
|
||||
public DataSourceType Type { get; set; }
|
||||
}
|
||||
@@ -9,35 +9,35 @@ public interface IERIDataSource : IExternalDataSource
|
||||
/// <summary>
|
||||
/// The hostname of the ERI server.
|
||||
/// </summary>
|
||||
public string Hostname { get; init; }
|
||||
public string Hostname { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The port of the ERI server.
|
||||
/// </summary>
|
||||
public int Port { get; init; }
|
||||
public int Port { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The authentication method to use.
|
||||
/// </summary>
|
||||
public AuthMethod AuthMethod { get; init; }
|
||||
public AuthMethod AuthMethod { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The username to use for authentication, when the auth. method is USERNAME_PASSWORD.
|
||||
/// </summary>
|
||||
public string Username { get; init; }
|
||||
public string Username { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// How username/password authentication should obtain the username.
|
||||
/// </summary>
|
||||
public DataSourceERIUsernamePasswordMode UsernamePasswordMode { get; init; }
|
||||
public DataSourceERIUsernamePasswordMode UsernamePasswordMode { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The ERI specification to use.
|
||||
/// </summary>
|
||||
public ERIVersion Version { get; init; }
|
||||
public ERIVersion Version { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The ID of the selected retrieval process.
|
||||
/// </summary>
|
||||
public string SelectedRetrievalId { get; init; }
|
||||
public string SelectedRetrievalId { get; set; }
|
||||
}
|
||||
@@ -9,7 +9,7 @@ public interface IExternalDataSource : IDataSource, ISecretId
|
||||
/// <summary>
|
||||
/// Which data security policy is applied to this external data source?
|
||||
/// </summary>
|
||||
public DataSourceSecurity SecurityPolicy { get; init; }
|
||||
public DataSourceSecurity SecurityPolicy { get; set; }
|
||||
|
||||
#region Implementation of ISecretId
|
||||
|
||||
|
||||
@@ -15,21 +15,21 @@ public interface IIndexedDataSource : IDataSourceBase
|
||||
/// <summary>
|
||||
/// Which provider confidence level is required by this data source?
|
||||
/// </summary>
|
||||
public ConfidenceLevel ConfidenceLevel { get; init; }
|
||||
public ConfidenceLevel ConfidenceLevel { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The unique identifier of the embedding provider used by this data source.
|
||||
/// </summary>
|
||||
public string EmbeddingId { get; init; }
|
||||
public string EmbeddingId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Optional maximum number of tokens per embedding chunk for this data source.
|
||||
/// A value of 0 means the embedding provider's setting is used.
|
||||
/// </summary>
|
||||
public int MaxChunkTokenLength { get; init; }
|
||||
public int MaxChunkTokenLength { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Optional number of tokens to overlap between consecutive chunks.
|
||||
/// </summary>
|
||||
public int ChunkOverlapTokenLength { get; init; }
|
||||
public int ChunkOverlapTokenLength { get; set; }
|
||||
}
|
||||
@@ -2,7 +2,7 @@ namespace AIStudio.Settings;
|
||||
|
||||
public sealed class ManagedEditableDefaultState
|
||||
{
|
||||
public Guid ConfigPluginId { get; init; } = Guid.Empty;
|
||||
public Guid ConfigPluginId { get; set; } = Guid.Empty;
|
||||
|
||||
public string LastAppliedValue { get; init; } = string.Empty;
|
||||
public string LastAppliedValue { get; set; } = string.Empty;
|
||||
}
|
||||
@@ -15,6 +15,20 @@ public record Profile(
|
||||
bool IsEnterpriseConfiguration = false,
|
||||
Guid EnterpriseConfigurationPluginId = default): ConfigurationBaseObject
|
||||
{
|
||||
//
|
||||
// The properties of the parameters, declared again to be settable. The source generation of System.Text.Json
|
||||
// sets every init-only property while it creates the object, also one missing in the JSON, so its value from
|
||||
// the parameterless constructor would get lost. Keep them first and in the order of the parameters, which is
|
||||
// the order they get stored in:
|
||||
//
|
||||
public override uint Num { get; set; } = Num;
|
||||
public override string Id { get; set; } = Id;
|
||||
public override string Name { get; set; } = Name;
|
||||
public string NeedToKnow { get; set; } = NeedToKnow;
|
||||
public string Actions { get; set; } = Actions;
|
||||
public override bool IsEnterpriseConfiguration { get; set; } = IsEnterpriseConfiguration;
|
||||
public override Guid EnterpriseConfigurationPluginId { get; set; } = EnterpriseConfigurationPluginId;
|
||||
|
||||
public Profile() : this(0, Guid.Empty.ToString(), string.Empty, string.Empty, string.Empty)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -38,12 +38,39 @@ public sealed record Provider(
|
||||
Host Host = Host.NONE,
|
||||
HFInferenceProvider HFInferenceProvider = HFInferenceProvider.NONE,
|
||||
string AdditionalJsonApiParameters = "",
|
||||
[property: JsonConverter(typeof(DataDirectoryRelativePathConverter))] string TokenizerPath = "",
|
||||
string TokenizerPath = "",
|
||||
ProviderCapabilityOverrides? CapabilityOverrides = null,
|
||||
bool AllowUserProvidedAPIKey = false,
|
||||
string CustomIconDataUrl = "",
|
||||
bool PromptForUserAPIKey = false) : ConfigurationBaseObject, ISecretId, IUserProvidedAPIKey
|
||||
{
|
||||
//
|
||||
// The properties of the parameters, declared again to be settable. The source generation of System.Text.Json
|
||||
// sets every init-only property while it creates the object, also one missing in the JSON, so its value from
|
||||
// the parameterless constructor would get lost. Keep them first and in the order of the parameters, which is
|
||||
// the order they get stored in:
|
||||
//
|
||||
public override uint Num { get; set; } = Num;
|
||||
public override string Id { get; set; } = Id;
|
||||
public string InstanceName { get; set; } = InstanceName;
|
||||
public LLMProviders UsedLLMProvider { get; set; } = UsedLLMProvider;
|
||||
public Model Model { get; set; } = Model;
|
||||
public bool IsSelfHosted { get; set; } = IsSelfHosted;
|
||||
public override bool IsEnterpriseConfiguration { get; set; } = IsEnterpriseConfiguration;
|
||||
public override Guid EnterpriseConfigurationPluginId { get; set; } = EnterpriseConfigurationPluginId;
|
||||
public string Hostname { get; set; } = Hostname;
|
||||
public Host Host { get; set; } = Host;
|
||||
public HFInferenceProvider HFInferenceProvider { get; set; } = HFInferenceProvider;
|
||||
public string AdditionalJsonApiParameters { get; set; } = AdditionalJsonApiParameters;
|
||||
|
||||
[JsonConverter(typeof(DataDirectoryRelativePathConverter))]
|
||||
public string TokenizerPath { get; set; } = TokenizerPath;
|
||||
|
||||
public ProviderCapabilityOverrides? CapabilityOverrides { get; set; } = CapabilityOverrides;
|
||||
public bool AllowUserProvidedAPIKey { get; set; } = AllowUserProvidedAPIKey;
|
||||
public string CustomIconDataUrl { get; set; } = CustomIconDataUrl;
|
||||
public bool PromptForUserAPIKey { get; set; } = PromptForUserAPIKey;
|
||||
|
||||
private static readonly ILogger<Provider> LOGGER = Program.LOGGER_FACTORY.CreateLogger<Provider>();
|
||||
|
||||
public static readonly Provider NONE = new();
|
||||
@@ -86,7 +113,7 @@ public sealed record Provider(
|
||||
public override string Name
|
||||
{
|
||||
get => this.InstanceName;
|
||||
init => this.InstanceName = value;
|
||||
set => this.InstanceName = value;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
@@ -89,35 +89,35 @@ public sealed record ProviderCapabilityOverrides
|
||||
|
||||
[JsonPropertyName("AUDIO_INPUT")]
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
|
||||
public bool? AudioInput { get; init; }
|
||||
public bool? AudioInput { get; set; }
|
||||
|
||||
[JsonPropertyName("FUNCTION_CALLING")]
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
|
||||
public bool? FunctionCalling { get; init; }
|
||||
public bool? FunctionCalling { get; set; }
|
||||
|
||||
[JsonPropertyName("MULTIPLE_IMAGE_INPUT")]
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
|
||||
public bool? MultipleImageInput { get; init; }
|
||||
public bool? MultipleImageInput { get; set; }
|
||||
|
||||
[JsonPropertyName("SPEECH_INPUT")]
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
|
||||
public bool? SpeechInput { get; init; }
|
||||
public bool? SpeechInput { get; set; }
|
||||
|
||||
[JsonPropertyName("VIDEO_INPUT")]
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
|
||||
public bool? VideoInput { get; init; }
|
||||
public bool? VideoInput { get; set; }
|
||||
|
||||
[JsonPropertyName("OPTIONAL_REASONING")]
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
|
||||
public bool? OptionalReasoning { get; init; }
|
||||
public bool? OptionalReasoning { get; set; }
|
||||
|
||||
[JsonPropertyName("ALWAYS_REASONING")]
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
|
||||
public bool? AlwaysReasoning { get; init; }
|
||||
public bool? AlwaysReasoning { get; set; }
|
||||
|
||||
[JsonPropertyName("REASONING_BY_DEFAULT")]
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
|
||||
public bool? ReasoningByDefault { get; init; }
|
||||
public bool? ReasoningByDefault { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// How many tokens this installation reads and writes, or null to keep the automatic answer.
|
||||
@@ -131,21 +131,21 @@ public sealed record ProviderCapabilityOverrides
|
||||
/// </remarks>
|
||||
[JsonPropertyName(CONTEXT_WINDOW_KEY)]
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
|
||||
public int? ContextWindowTokens { get; init; }
|
||||
public int? ContextWindowTokens { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// How many images one message may carry, or null to keep the automatic answer.
|
||||
/// </summary>
|
||||
[JsonPropertyName(MAX_IMAGES_PER_MESSAGE_KEY)]
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
|
||||
public int? MaxImagesPerMessage { get; init; }
|
||||
public int? MaxImagesPerMessage { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// How many images one request may carry, or null to keep the automatic answer.
|
||||
/// </summary>
|
||||
[JsonPropertyName(MAX_IMAGES_PER_REQUEST_KEY)]
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
|
||||
public int? MaxImagesPerRequest { get; init; }
|
||||
public int? MaxImagesPerRequest { get; set; }
|
||||
|
||||
[JsonIgnore]
|
||||
public bool HasOverrides =>
|
||||
|
||||
@@ -0,0 +1,43 @@
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
using AIStudio.Provider;
|
||||
using AIStudio.Settings.DataModel;
|
||||
using AIStudio.Settings.DataModel.PreviousModels;
|
||||
|
||||
using EMailWritingStyles = AIStudio.Assistants.EMail.WritingStyles;
|
||||
using ERIContentType = AIStudio.Tools.ERIClient.DataModel.ContentType;
|
||||
using ProviderV4 = AIStudio.Settings.DataModel.PreviousModels.Provider;
|
||||
using RewriteImproveWritingStyles = AIStudio.Assistants.RewriteImprove.WritingStyles;
|
||||
|
||||
namespace AIStudio.Settings;
|
||||
|
||||
/// <summary>
|
||||
/// The contracts with which System.Text.Json reads and writes the settings, built at compile time.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Besides the settings and their older versions, which the migrations still read, the values of managed
|
||||
/// settings get written and read on their own, as the type of their setting. That type is often an interface,
|
||||
/// such as ISet<string>, which the settings themselves never use. A test fails for a managed setting
|
||||
/// whose type is missing here.<br/><br/>
|
||||
///
|
||||
/// Two types with the same name need a name of their own for their contract, else the generator builds
|
||||
/// only the first of them and warns with SYSLIB1031.
|
||||
/// </remarks>
|
||||
[JsonSourceGenerationOptions(GenerationMode = JsonSourceGenerationMode.Metadata)]
|
||||
[JsonSerializable(typeof(Data))]
|
||||
[JsonSerializable(typeof(DataV1V3))]
|
||||
[JsonSerializable(typeof(DataV4))]
|
||||
[JsonSerializable(typeof(DataV5))]
|
||||
[JsonSerializable(typeof(ISet<string>))]
|
||||
[JsonSerializable(typeof(ISet<PreviewFeatures>))]
|
||||
[JsonSerializable(typeof(ISet<LLMProviders>))]
|
||||
[JsonSerializable(typeof(ISet<ConfigurableAssistant>))]
|
||||
[JsonSerializable(typeof(IList<string>))]
|
||||
[JsonSerializable(typeof(IList<DataAssistantPluginEnterpriseApproval>))]
|
||||
[JsonSerializable(typeof(IDictionary<string, string>))]
|
||||
[JsonSerializable(typeof(ProviderV4), TypeInfoPropertyName = "ProviderV4")]
|
||||
[JsonSerializable(typeof(List<ProviderV4>), TypeInfoPropertyName = "ListProviderV4")]
|
||||
[JsonSerializable(typeof(EMailWritingStyles), TypeInfoPropertyName = "EMailWritingStyles")]
|
||||
[JsonSerializable(typeof(RewriteImproveWritingStyles), TypeInfoPropertyName = "RewriteImproveWritingStyles")]
|
||||
[JsonSerializable(typeof(ERIContentType), TypeInfoPropertyName = "ERIContentType")]
|
||||
internal sealed partial class SettingsJsonContext : JsonSerializerContext;
|
||||
@@ -26,11 +26,12 @@ public sealed class SettingsManager
|
||||
|
||||
private readonly record struct CurrentSettingsReadResult(Data? SettingsData, SettingsWriteBlockReason FailureReason);
|
||||
|
||||
internal static readonly JsonSerializerOptions JSON_OPTIONS = new()
|
||||
internal static readonly JsonSerializerOptions JSON_OPTIONS = new JsonSerializerOptions
|
||||
{
|
||||
WriteIndented = true,
|
||||
Converters = { new TolerantEnumConverter() },
|
||||
};
|
||||
TypeInfoResolver = SettingsJsonContext.Default,
|
||||
}.AsReadOnly();
|
||||
|
||||
/// <summary>
|
||||
/// From this duration on, storing the settings is reported as slow.
|
||||
|
||||
@@ -27,6 +27,27 @@ public sealed record TranscriptionProvider(
|
||||
HFInferenceProvider HFInferenceProvider = HFInferenceProvider.NONE,
|
||||
bool PromptForUserAPIKey = false) : ConfigurationBaseObject, ISecretId, IUserProvidedAPIKey
|
||||
{
|
||||
//
|
||||
// The properties of the parameters, declared again to be settable. The source generation of System.Text.Json
|
||||
// sets every init-only property while it creates the object, also one missing in the JSON, so its value from
|
||||
// the parameterless constructor would get lost. Keep them first and in the order of the parameters, which is
|
||||
// the order they get stored in:
|
||||
//
|
||||
public override uint Num { get; set; } = Num;
|
||||
public override string Id { get; set; } = Id;
|
||||
public override string Name { get; set; } = Name;
|
||||
public LLMProviders UsedLLMProvider { get; set; } = UsedLLMProvider;
|
||||
public Model Model { get; set; } = Model;
|
||||
public bool IsSelfHosted { get; set; } = IsSelfHosted;
|
||||
public override bool IsEnterpriseConfiguration { get; set; } = IsEnterpriseConfiguration;
|
||||
public override Guid EnterpriseConfigurationPluginId { get; set; } = EnterpriseConfigurationPluginId;
|
||||
public string Hostname { get; set; } = Hostname;
|
||||
public Host Host { get; set; } = Host;
|
||||
public bool AllowUserProvidedAPIKey { get; set; } = AllowUserProvidedAPIKey;
|
||||
public string CustomIconDataUrl { get; set; } = CustomIconDataUrl;
|
||||
public HFInferenceProvider HFInferenceProvider { get; set; } = HFInferenceProvider;
|
||||
public bool PromptForUserAPIKey { get; set; } = PromptForUserAPIKey;
|
||||
|
||||
private static readonly ILogger<TranscriptionProvider> LOGGER = Program.LOGGER_FACTORY.CreateLogger<TranscriptionProvider>();
|
||||
|
||||
public static readonly TranscriptionProvider NONE = new();
|
||||
|
||||
@@ -51,12 +51,13 @@ public static class DataBackupFormat
|
||||
/// How the manifest and the plan of a restore are written: readable for anybody who opens them,
|
||||
/// and for the runtime, which applies the plan.
|
||||
/// </summary>
|
||||
public static readonly JsonSerializerOptions JSON_OPTIONS = new()
|
||||
public static readonly JsonSerializerOptions JSON_OPTIONS = new JsonSerializerOptions
|
||||
{
|
||||
WriteIndented = true,
|
||||
PropertyNamingPolicy = JsonNamingPolicy.SnakeCaseLower,
|
||||
Converters = { new JsonStringEnumConverter() },
|
||||
};
|
||||
TypeInfoResolver = DataBackupJsonContext.Default,
|
||||
}.AsReadOnly();
|
||||
|
||||
/// <summary>
|
||||
/// File types which are compressed already. Compressing them once more costs time and makes the
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace AIStudio.Tools.DataBackup;
|
||||
|
||||
/// <summary>
|
||||
/// The contracts with which System.Text.Json reads and writes the manifest of a backup and the plan and report of
|
||||
/// a restore, built at compile time.
|
||||
/// </summary>
|
||||
[JsonSourceGenerationOptions(GenerationMode = JsonSourceGenerationMode.Metadata)]
|
||||
[JsonSerializable(typeof(DataBackupManifest))]
|
||||
[JsonSerializable(typeof(DataRestorePlan))]
|
||||
[JsonSerializable(typeof(DataRestoreReport))]
|
||||
internal sealed partial class DataBackupJsonContext : JsonSerializerContext;
|
||||
@@ -0,0 +1,11 @@
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace AIStudio.Tools.Databases.ProvenanceStore;
|
||||
|
||||
/// <summary>
|
||||
/// The contracts with which System.Text.Json reads and writes the content around a passage, built at compile time.
|
||||
/// </summary>
|
||||
[JsonSourceGenerationOptions(GenerationMode = JsonSourceGenerationMode.Metadata)]
|
||||
[JsonSerializable(typeof(IReadOnlyList<string>))]
|
||||
[JsonSerializable(typeof(List<string>))]
|
||||
internal sealed partial class ProvenanceJsonContext : JsonSerializerContext;
|
||||
+6
-2
@@ -39,7 +39,11 @@ public sealed class SqliteProvenanceStoreClientImplementation(string name, strin
|
||||
/// Writes the content around a passage the way it reads: the default encoder would turn every
|
||||
/// character outside ASCII into an escape, cf. ToolExecutionResult.MODEL_CONTENT_OPTIONS.
|
||||
/// </summary>
|
||||
private static readonly JsonSerializerOptions JSON_OPTIONS = new() { Encoder = JavaScriptEncoder.UnsafeRelaxedJsonEscaping };
|
||||
internal static readonly JsonSerializerOptions JSON_OPTIONS = new JsonSerializerOptions
|
||||
{
|
||||
Encoder = JavaScriptEncoder.UnsafeRelaxedJsonEscaping,
|
||||
TypeInfoResolver = ProvenanceJsonContext.Default,
|
||||
}.AsReadOnly();
|
||||
|
||||
private readonly string databasePath = databasePath;
|
||||
private readonly string lastCleanupPath = Path.Join(basePath, LAST_CLEANUP_FILENAME);
|
||||
@@ -351,7 +355,7 @@ public sealed class SqliteProvenanceStoreClientImplementation(string name, strin
|
||||
|
||||
try
|
||||
{
|
||||
return JsonSerializer.Deserialize<List<string>>(row.SurroundingContent) ?? [];
|
||||
return JsonSerializer.Deserialize<List<string>>(row.SurroundingContent, JSON_OPTIONS) ?? [];
|
||||
}
|
||||
catch (JsonException exception)
|
||||
{
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
using System.Text.Json;
|
||||
|
||||
namespace AIStudio.Tools;
|
||||
|
||||
public static class JsonSerializerOptionsExtensions
|
||||
{
|
||||
/// <summary>
|
||||
/// Makes the options read-only and returns them, so that a static field gets its options in one expression.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Options with contracts of their own, i.e., with a TypeInfoResolver, should never change after they were
|
||||
/// declared: whoever used them before such a change would have read or written with other contracts.
|
||||
/// </remarks>
|
||||
/// <param name="options">The options, with their TypeInfoResolver set.</param>
|
||||
/// <returns>The same options, now read-only.</returns>
|
||||
public static JsonSerializerOptions AsReadOnly(this JsonSerializerOptions options)
|
||||
{
|
||||
options.MakeReadOnly();
|
||||
return options;
|
||||
}
|
||||
}
|
||||
@@ -4,13 +4,13 @@ namespace AIStudio.Tools.PluginSystem.Assistants;
|
||||
|
||||
public sealed class PluginAssistantAudit
|
||||
{
|
||||
public Guid PluginId { get; init; }
|
||||
public string PluginHash { get; init; } = string.Empty;
|
||||
public Guid PluginId { get; set; }
|
||||
public string PluginHash { get; set; } = string.Empty;
|
||||
public DateTimeOffset AuditedAtUtc { get; set; }
|
||||
public string AuditProviderId { get; set; } = string.Empty;
|
||||
public string AuditProviderName { get; set; } = string.Empty;
|
||||
public AssistantAuditLevel Level { get; init; } = AssistantAuditLevel.UNKNOWN;
|
||||
public string Summary { get; init; } = string.Empty;
|
||||
public AssistantAuditLevel Level { get; set; } = AssistantAuditLevel.UNKNOWN;
|
||||
public string Summary { get; set; } = string.Empty;
|
||||
public float Confidence { get; set; }
|
||||
public string PromptPreview { get; set; } = string.Empty;
|
||||
public List<AssistantAuditFinding> Findings { get; set; } = [];
|
||||
|
||||
@@ -5,19 +5,19 @@ public abstract record ConfigurationBaseObject : IConfigurationObject
|
||||
#region Implementation of IConfigurationObject
|
||||
|
||||
/// <inheritdoc />
|
||||
public abstract string Id { get; init; }
|
||||
public abstract string Id { get; set; }
|
||||
|
||||
/// <inheritdoc />
|
||||
public abstract uint Num { get; init; }
|
||||
public abstract uint Num { get; set; }
|
||||
|
||||
/// <inheritdoc />
|
||||
public abstract string Name { get; init; }
|
||||
public abstract string Name { get; set; }
|
||||
|
||||
/// <inheritdoc />
|
||||
public abstract bool IsEnterpriseConfiguration { get; init; }
|
||||
public abstract bool IsEnterpriseConfiguration { get; set; }
|
||||
|
||||
/// <inheritdoc />
|
||||
public abstract Guid EnterpriseConfigurationPluginId { get; init; }
|
||||
public abstract Guid EnterpriseConfigurationPluginId { get; set; }
|
||||
|
||||
#endregion
|
||||
}
|
||||
@@ -32,7 +32,7 @@ public sealed class RetrievalImageContext : IRetrievalContext, IImageSource
|
||||
/// <remarks>
|
||||
/// Is the image source a URL, a local file path, a base64 string, etc.?
|
||||
/// </remarks>
|
||||
public required ContentImageSource SourceType { get; init; }
|
||||
public required ContentImageSource SourceType { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The image source.
|
||||
|
||||
@@ -25,27 +25,27 @@ public sealed record SourcePassage
|
||||
/// the passage. The list of sources tells sources apart by their address without the fragment,
|
||||
/// and so does the search for the passages of a source, see GetPassagesOf.
|
||||
/// </remarks>
|
||||
public string SourceUrl { get; init; } = string.Empty;
|
||||
public string SourceUrl { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// The name of where the passage was found, e.g., a document or a database.
|
||||
/// </summary>
|
||||
public string DataSourceName { get; init; } = string.Empty;
|
||||
public string DataSourceName { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// The path to the content, e.g., a file path or a URL.
|
||||
/// </summary>
|
||||
public string Path { get; init; } = string.Empty;
|
||||
public string Path { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// The category of the content, like text or image.
|
||||
/// </summary>
|
||||
public RetrievalContentCategory Category { get; init; }
|
||||
public RetrievalContentCategory Category { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// What type of content the passage is, like a document or a transcript.
|
||||
/// </summary>
|
||||
public RetrievalContentType Type { get; init; }
|
||||
public RetrievalContentType Type { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The entry of the provenance store which holds the matched text and the content around it,
|
||||
@@ -57,7 +57,7 @@ public sealed record SourcePassage
|
||||
/// stored, Text and SurroundingContent are empty. Left out of the chat file while null.
|
||||
/// </remarks>
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
|
||||
public Guid? ProvenanceId { get; init; }
|
||||
public Guid? ProvenanceId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The matched text, filtered for prompt injections, as long as it is not stored, see ProvenanceId.
|
||||
@@ -65,22 +65,22 @@ public sealed record SourcePassage
|
||||
/// <remarks>
|
||||
/// Empty for an image which matched: the AI is only told that it did, never shown the image.
|
||||
/// </remarks>
|
||||
public string Text { get; init; } = string.Empty;
|
||||
public string Text { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// The content around the matched text, filtered for prompt injections, as long as it is not stored, see ProvenanceId.
|
||||
/// </summary>
|
||||
public IReadOnlyList<string> SurroundingContent { get; init; } = [];
|
||||
public IReadOnlyList<string> SurroundingContent { get; set; } = [];
|
||||
|
||||
/// <summary>
|
||||
/// The page the passage starts on, or null when it has none.
|
||||
/// </summary>
|
||||
public int? PageNumber { get; init; }
|
||||
public int? PageNumber { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The page the passage ends on, or null when it is not known.
|
||||
/// </summary>
|
||||
public int? EndPageNumber { get; init; }
|
||||
public int? EndPageNumber { get; set; }
|
||||
|
||||
//
|
||||
// Where a passage without pages is. Left out of the chat file while unknown, which they are for
|
||||
@@ -91,31 +91,31 @@ public sealed record SourcePassage
|
||||
/// The sheet of a spreadsheet the passage is from, or null.
|
||||
/// </summary>
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
|
||||
public string? SheetName { get; init; }
|
||||
public string? SheetName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The row the passage starts at, counted from one: a row of its sheet, or of a table such as a CSV file.
|
||||
/// </summary>
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
|
||||
public int? StartRow { get; init; }
|
||||
public int? StartRow { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The row the passage ends at, or null when it is not known.
|
||||
/// </summary>
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
|
||||
public int? EndRow { get; init; }
|
||||
public int? EndRow { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The line the passage starts at, counted from one, for text and source code, or null.
|
||||
/// </summary>
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
|
||||
public int? StartLine { get; init; }
|
||||
public int? StartLine { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The line the passage ends at, or null when it is not known.
|
||||
/// </summary>
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
|
||||
public int? EndLine { get; init; }
|
||||
public int? EndLine { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Which part of its document the passage is, counted from one, or null when the data source
|
||||
@@ -126,5 +126,5 @@ public sealed record SourcePassage
|
||||
/// indexed before these were kept. Wherever they are known, they say it better, see
|
||||
/// SourcePassageExtensions.GetLocation.
|
||||
/// </remarks>
|
||||
public int? ChunkNumber { get; init; }
|
||||
public int? ChunkNumber { get; set; }
|
||||
}
|
||||
@@ -63,7 +63,7 @@ public static partial class WorkspaceBehaviour
|
||||
|
||||
private static string TB(string fallbackEN) => I18N.I.T(fallbackEN, typeof(WorkspaceBehaviour).Namespace, nameof(WorkspaceBehaviour));
|
||||
|
||||
public static readonly JsonSerializerOptions JSON_OPTIONS = new()
|
||||
public static readonly JsonSerializerOptions JSON_OPTIONS = new JsonSerializerOptions
|
||||
{
|
||||
WriteIndented = true,
|
||||
AllowTrailingCommas = true,
|
||||
@@ -73,8 +73,9 @@ public static partial class WorkspaceBehaviour
|
||||
Converters =
|
||||
{
|
||||
new JsonStringEnumConverter(JsonNamingPolicy.SnakeCaseUpper),
|
||||
}
|
||||
};
|
||||
},
|
||||
TypeInfoResolver = ChatJsonContext.Default,
|
||||
}.AsReadOnly();
|
||||
|
||||
private static readonly TimeSpan PREFETCH_DELAY_DURATION = TimeSpan.FromMilliseconds(45);
|
||||
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
- Improved the documentation for IT departments, which now lives in our [wiki](https://github.com/MindWorkAI/AI-Studio/wiki/Enterprise-IT). It is sorted by task, explains the setup on Windows, Linux, and macOS, and offers complete configurations for typical needs, such as using only local models. The link in the app settings leads there, and the wiki also holds the installation guide in English and German.
|
||||
- Improved the German translation throughout: we proofread all texts and corrected wrong labels as well as spelling and grammar mistakes. The texts now always address you formally and use the same terms everywhere.
|
||||
- Improved the security of the connection between the app window and AI Studio.
|
||||
- Improved how reliably AI Studio reads and stores your settings, chats, and backups.
|
||||
- Changed the size of AI Studio on laptop screens: it now appears in the same size on every laptop, whatever the scaling of your operating system. If you prefer the previous size, choose "System scaling" for the interface size in the app settings. Contributed by Paul Koudelka.
|
||||
- Fixed AI Studio becoming unusable when an update failed after its download. The app now restarts with the version you have installed, so you can simply try the update again.
|
||||
- Fixed configuration plugins you installed yourself being able to change the tool settings of your organization, such as the minimum provider confidence of a tool. These settings now follow the same rules as all other settings, which also gives you back your own values once your organization removes its configuration.
|
||||
|
||||
Reference in new issue
Block a user