AI DevKit
Search Results for

    Show / Hide Table of Contents

    Class ChatContent

    -- Class hierarchy --
    Text: ChatCompletion > ChatChoice[] > ChatMessage[] > ChatContent > TextOrChatContentPart > Text
    ChatContentPart: ChatCompletion > ChatChoice[] > ChatMessage[] > ChatContent > TextOrChatContentPart > ChatContentPart[]

    Inheritance
    object
    ChatContent
    Namespace: Glitch9.AIDevKit
    Assembly: .dll
    Syntax
    public class ChatContent

    Constructors

    ChatContent()

    Declaration
    public ChatContent()

    ChatContent(TextOrChatContentPart[])

    Declaration
    public ChatContent(TextOrChatContentPart[] parts)
    Parameters
    Type Name Description
    TextOrChatContentPart[] parts

    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
    Type Description
    bool

    IsEmpty

    Declaration
    public bool IsEmpty { get; }
    Property Value
    Type Description
    bool

    IsString

    Declaration
    public bool IsString { get; }
    Property Value
    Type Description
    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.

    Declaration
    public int Length { get; }
    Property Value
    Type Description
    int

    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
    Name Description
    T

    AddPart<T>(T)

    Declaration
    public void AddPart<T>(T part) where T : ChatContentPart
    Parameters
    Type Name Description
    T part
    Type Parameters
    Name Description
    T

    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
    Type Description
    ChatContent

    FromParts(IEnumerable<ChatContentPart>)

    Declaration
    public static ChatContent FromParts(IEnumerable<ChatContentPart> parts)
    Parameters
    Type Name Description
    IEnumerable<ChatContentPart> parts
    Returns
    Type Description
    ChatContent

    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
    Type Name Description
    ChatContent content
    Returns
    Type Description
    string

    implicit operator ChatContent(TextOrChatContentPart[])

    Declaration
    public static implicit operator ChatContent(TextOrChatContentPart[] parts)
    Parameters
    Type Name Description
    TextOrChatContentPart[] parts
    Returns
    Type Description
    ChatContent

    implicit operator ChatContent(string)

    Declaration
    public static implicit operator ChatContent(string text)
    Parameters
    Type Name Description
    string text
    Returns
    Type Description
    ChatContent
    In this article
    Back to top Generated by DocFX