Class ChatContent
-- Class hierarchy --
Text: ChatCompletion > ChatChoice[] > ChatMessage[] > ChatContent > TextOrChatContentPart > Text
ChatContentPart: ChatCompletion > ChatChoice[] > ChatMessage[] > ChatContent > TextOrChatContentPart > ChatContentPart[]
Inheritance
object
ChatContent
Assembly: .dll
Syntax
Constructors
ChatContent()
Declaration
ChatContent(TextOrChatContentPart[])
Declaration
public ChatContent(TextOrChatContentPart[] parts)
Parameters
ChatContent(string)
Declaration
public ChatContent(string text)
Parameters
Type |
Name |
Description |
string |
text |
|
ChatContent(string[])
Declaration
public ChatContent(string[] texts)
Parameters
Type |
Name |
Description |
string[] |
texts |
|
Properties
HasValue
Declaration
public bool HasValue { get; }
Property Value
IsEmpty
Declaration
public bool IsEmpty { get; }
Property Value
IsString
Declaration
public bool IsString { get; }
Property Value
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.
Declaration
public int Length { get; }
Property Value
Methods
AddPartRange<T>(IEnumerable<T>)
Declaration
public void AddPartRange<T>(IEnumerable<T> parts) where T : ChatContentPart
Parameters
Type |
Name |
Description |
IEnumerable<T> |
parts |
|
Type Parameters
AddPart<T>(T)
Declaration
public void AddPart<T>(T part) where T : ChatContentPart
Parameters
Type |
Name |
Description |
T |
part |
|
Type Parameters
AttachFiles(IEnumerable<IFile>)
Declaration
public void AttachFiles(IEnumerable<IFile> attachedFiles)
Parameters
Type |
Name |
Description |
IEnumerable<IFile> |
attachedFiles |
|
Create(string, IEnumerable<IFile>)
Declaration
public static ChatContent Create(string promptText, IEnumerable<IFile> attachedFiles = null)
Parameters
Type |
Name |
Description |
string |
promptText |
|
IEnumerable<IFile> |
attachedFiles |
|
Returns
FromParts(IEnumerable<ChatContentPart>)
Declaration
public static ChatContent FromParts(IEnumerable<ChatContentPart> parts)
Parameters
Returns
ReplaceText(string)
Declaration
public void ReplaceText(string newText)
Parameters
Type |
Name |
Description |
string |
newText |
|
ToString()
Returns a string that represents the current object.
Declaration
public override string ToString()
Returns
Type |
Description |
string |
A string that represents the current object.
|
Overrides
object.ToString()
Operators
implicit operator string(ChatContent)
Declaration
public static implicit operator string(ChatContent content)
Parameters
Returns
implicit operator ChatContent(TextOrChatContentPart[])
Declaration
public static implicit operator ChatContent(TextOrChatContentPart[] parts)
Parameters
Returns
implicit operator ChatContent(string)
Declaration
public static implicit operator ChatContent(string text)
Parameters
Type |
Name |
Description |
string |
text |
|
Returns