Refactored data classes into dedicated files

This commit is contained in:
Thorsten Sommer 2025-09-03 09:34:04 +02:00
parent 9d31ce62c3
commit b7f69ed8db
Signed by: tsommer
GPG Key ID: 371BBA77A02C0108
4 changed files with 24 additions and 21 deletions

View File

@ -0,0 +1,8 @@
namespace AIStudio.Provider.Perplexity;
/// <summary>
/// Data model for a choice made by the AI.
/// </summary>
/// <param name="Index">The index of the choice.</param>
/// <param name="Delta">The delta text of the choice.</param>
public readonly record struct Choice(int Index, Delta Delta);

View File

@ -0,0 +1,7 @@
namespace AIStudio.Provider.Perplexity;
/// <summary>
/// The delta text of a choice.
/// </summary>
/// <param name="Content">The content of the delta text.</param>
public readonly record struct Delta(string Content);

View File

@ -22,24 +22,4 @@ public readonly record struct ResponseStreamLine(string Id, string Object, uint
/// <inheritdoc /> /// <inheritdoc />
public IList<ISource> GetSources() => this.SearchResults.Cast<ISource>().ToList(); public IList<ISource> GetSources() => this.SearchResults.Cast<ISource>().ToList();
} }
/// <summary>
/// Data model for a choice made by the AI.
/// </summary>
/// <param name="Index">The index of the choice.</param>
/// <param name="Delta">The delta text of the choice.</param>
public readonly record struct Choice(int Index, Delta Delta);
/// <summary>
/// The delta text of a choice.
/// </summary>
/// <param name="Content">The content of the delta text.</param>
public readonly record struct Delta(string Content);
/// <summary>
/// Data model for a search result.
/// </summary>
/// <param name="Title">The title of the search result.</param>
/// <param name="URL">The URL of the search result.</param>
public sealed record SearchResult(string Title, string URL) : Source(Title, URL);

View File

@ -0,0 +1,8 @@
namespace AIStudio.Provider.Perplexity;
/// <summary>
/// Data model for a search result.
/// </summary>
/// <param name="Title">The title of the search result.</param>
/// <param name="URL">The URL of the search result.</param>
public sealed record SearchResult(string Title, string URL) : Source(Title, URL);