mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2025-08-21 04:12: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>
|
/// </summary>
|
||||||
public bool HideFromUser { get; init; }
|
public bool HideFromUser { get; init; }
|
||||||
|
|
||||||
public ContentBlock DeepClone()
|
public ContentBlock DeepClone() => new()
|
||||||
{
|
{
|
||||||
return new()
|
Time = this.Time,
|
||||||
{
|
ContentType = this.ContentType,
|
||||||
Time = this.Time,
|
Content = this.Content?.DeepClone(),
|
||||||
ContentType = this.ContentType,
|
Role = this.Role,
|
||||||
Content = this.Content?.DeepClone(),
|
HideFromUser = this.HideFromUser,
|
||||||
Role = this.Role,
|
};
|
||||||
HideFromUser = this.HideFromUser,
|
|
||||||
};
|
|
||||||
}
|
|
||||||
}
|
}
|
@ -34,16 +34,13 @@ public sealed class ContentImage : IContent, IImageSource
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public IContent DeepClone()
|
public IContent DeepClone() => new ContentImage
|
||||||
{
|
{
|
||||||
return new ContentImage
|
Source = this.Source,
|
||||||
{
|
InitialRemoteWait = this.InitialRemoteWait,
|
||||||
Source = this.Source,
|
IsStreaming = this.IsStreaming,
|
||||||
InitialRemoteWait = this.InitialRemoteWait,
|
SourceType = this.SourceType,
|
||||||
IsStreaming = this.IsStreaming,
|
};
|
||||||
SourceType = this.SourceType,
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
@ -126,15 +126,12 @@ public sealed class ContentText : IContent
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public IContent DeepClone()
|
public IContent DeepClone() => new ContentText
|
||||||
{
|
{
|
||||||
return new ContentText
|
Text = this.Text,
|
||||||
{
|
InitialRemoteWait = this.InitialRemoteWait,
|
||||||
Text = this.Text,
|
IsStreaming = this.IsStreaming,
|
||||||
InitialRemoteWait = this.InitialRemoteWait,
|
};
|
||||||
IsStreaming = this.IsStreaming,
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user