Class ChatContent
-- Class hierarchy --
Text: ChatCompletion > ChatChoice[] > ChatMessage[] > ChatContent > TextOrChatContentPart > Text
ChatContentPart: ChatCompletion > ChatChoice[] > ChatMessage[] > ChatContent > TextOrChatContentPart > ChatContentPart[]
public class ChatContent
- Inheritance
-
objectChatContent
Constructors
ChatContent()
public ChatContent()
ChatContent(TextOrChatContentPart[])
public ChatContent(TextOrChatContentPart[] parts)
Parameters
partsTextOrChatContentPart[]
ChatContent(string)
public ChatContent(string text)
Parameters
textstring
ChatContent(string[])
public ChatContent(string[] texts)
Parameters
textsstring[]
Properties
HasValue
public bool HasValue { get; }
Property Value
- bool
IsEmpty
public bool IsEmpty { get; }
Property Value
- bool
IsString
public bool IsString { get; }
Property Value
- bool
Length
Returns the length of the array if the value is an array, returns the length of the string if the value is a string, otherwise returns 0.
public int Length { get; }
Property Value
- int
Methods
AddPartRange<T>(IEnumerable<T>)
public void AddPartRange<T>(IEnumerable<T> parts) where T : ChatContentPart
Parameters
partsIEnumerable<T>
Type Parameters
T
AddPart<T>(T)
public void AddPart<T>(T part) where T : ChatContentPart
Parameters
partT
Type Parameters
T
AttachFiles(IEnumerable<IFile>)
public void AttachFiles(IEnumerable<IFile> attachedFiles)
Parameters
attachedFilesIEnumerable<IFile>
Create(string, IEnumerable<IFile>)
public static ChatContent Create(string promptText, IEnumerable<IFile> attachedFiles = null)
Parameters
promptTextstringattachedFilesIEnumerable<IFile>
Returns
FromParts(IEnumerable<ChatContentPart>)
public static ChatContent FromParts(IEnumerable<ChatContentPart> parts)
Parameters
partsIEnumerable<ChatContentPart>
Returns
ReplaceText(string)
public void ReplaceText(string newText)
Parameters
newTextstring
ToString()
Returns a string that represents the current object.
public override string ToString()
Returns
- string
A string that represents the current object.
Operators
implicit operator string(ChatContent)
public static implicit operator string(ChatContent content)
Parameters
contentChatContent
Returns
- string
implicit operator ChatContent(TextOrChatContentPart[])
public static implicit operator ChatContent(TextOrChatContentPart[] parts)
Parameters
partsTextOrChatContentPart[]
Returns
implicit operator ChatContent(string)
public static implicit operator ChatContent(string text)
Parameters
textstring