mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2026-11-04 20:07:20 +00:00
Made the JSON types of the providers settable instead of init-only
This commit is contained in:
44 files changed
+241
-82
No files matched your search
@@ -5,4 +5,15 @@ namespace AIStudio.Tools;
|
||||
/// </summary>
|
||||
/// <param name="Title">The title of the source.</param>
|
||||
/// <param name="URL">The URL of the source.</param>
|
||||
public record Source(string Title, string URL, SourceOrigin Origin) : ISource;
|
||||
public record Source(string Title, string URL, SourceOrigin Origin) : ISource
|
||||
{
|
||||
//
|
||||
// The properties of the parameters, declared again to be settable. A derived record which passes a value of
|
||||
// its own to one of them, as the search results of Perplexity do with the origin, would otherwise lose it:
|
||||
// the source generation of System.Text.Json sets every init-only property while it creates the object, also
|
||||
// one missing in the JSON. Keep them in the order of the parameters, which is the order they get stored in:
|
||||
//
|
||||
public string Title { get; set; } = Title;
|
||||
public string URL { get; set; } = URL;
|
||||
public SourceOrigin Origin { get; set; } = Origin;
|
||||
}
|
||||
Reference in new issue
Block a user