mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2025-08-20 22:32:56 +00:00
Refactor DeepClone methods to use expression-bodied members.
This commit is contained in:
parent
59373a0e60
commit
fc103ff346
@ -30,15 +30,12 @@ public class ContentBlock
|
||||
/// </summary>
|
||||
public bool HideFromUser { get; init; }
|
||||
|
||||
public ContentBlock DeepClone()
|
||||
public ContentBlock DeepClone() => new()
|
||||
{
|
||||
return new()
|
||||
{
|
||||
Time = this.Time,
|
||||
ContentType = this.ContentType,
|
||||
Content = this.Content?.DeepClone(),
|
||||
Role = this.Role,
|
||||
HideFromUser = this.HideFromUser,
|
||||
};
|
||||
}
|
||||
Time = this.Time,
|
||||
ContentType = this.ContentType,
|
||||
Content = this.Content?.DeepClone(),
|
||||
Role = this.Role,
|
||||
HideFromUser = this.HideFromUser,
|
||||
};
|
||||
}
|
@ -34,16 +34,13 @@ public sealed class ContentImage : IContent, IImageSource
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public IContent DeepClone()
|
||||
public IContent DeepClone() => new ContentImage
|
||||
{
|
||||
return new ContentImage
|
||||
{
|
||||
Source = this.Source,
|
||||
InitialRemoteWait = this.InitialRemoteWait,
|
||||
IsStreaming = this.IsStreaming,
|
||||
SourceType = this.SourceType,
|
||||
};
|
||||
}
|
||||
Source = this.Source,
|
||||
InitialRemoteWait = this.InitialRemoteWait,
|
||||
IsStreaming = this.IsStreaming,
|
||||
SourceType = this.SourceType,
|
||||
};
|
||||
|
||||
#endregion
|
||||
|
||||
|
@ -126,15 +126,12 @@ public sealed class ContentText : IContent
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public IContent DeepClone()
|
||||
public IContent DeepClone() => new ContentText
|
||||
{
|
||||
return new ContentText
|
||||
{
|
||||
Text = this.Text,
|
||||
InitialRemoteWait = this.InitialRemoteWait,
|
||||
IsStreaming = this.IsStreaming,
|
||||
};
|
||||
}
|
||||
Text = this.Text,
|
||||
InitialRemoteWait = this.InitialRemoteWait,
|
||||
IsStreaming = this.IsStreaming,
|
||||
};
|
||||
|
||||
#endregion
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user