Interface RenderUserDefinedState

interface RenderUserDefinedState {
    fullMessage?: Message;
    messageItem?: GenericItem;
    partialItems?: {
        agent_message_type?: AgentMessageType;
        message_options?: {
            chain_of_thought?: {
                description?: string;
                request?: { args?: {} };
                response?: { content?: {} };
                status?: ChainOfThoughtStepStatus;
                title?: string;
                tool_name?: string;
            }[];
            feedback?: {
                categories?: string[];
                disclaimer?: string;
                id?: string;
                is_on?: boolean;
                placeholder?: string;
                prompt?: string;
                show_negative_details?: boolean;
                show_positive_details?: boolean;
                show_prompt?: boolean;
                show_text_area?: boolean;
                title?: string;
            };
        };
        response_type?: MessageResponseTypes;
        streaming_metadata?: {
            cancellable?: boolean;
            id?: string;
            stream_stopped?: boolean;
        };
        user_defined?: { [key: string]: {} };
    }[];
}

Properties

fullMessage?: Message

The entire message object received when the entire message (not just the individual messageItem) has finished processing.

messageItem?: GenericItem

The messageItem after all partial chunks are received. This will first be set to the value of the complete_item chunk. Once the fullMessage is resolved, this value will update to the value of the item in the fullMessage, which will be the same value unless you have done any post-processing mutations.

partialItems?: {
    agent_message_type?: AgentMessageType;
    message_options?: {
        chain_of_thought?: {
            description?: string;
            request?: { args?: {} };
            response?: { content?: {} };
            status?: ChainOfThoughtStepStatus;
            title?: string;
            tool_name?: string;
        }[];
        feedback?: {
            categories?: string[];
            disclaimer?: string;
            id?: string;
            is_on?: boolean;
            placeholder?: string;
            prompt?: string;
            show_negative_details?: boolean;
            show_positive_details?: boolean;
            show_prompt?: boolean;
            show_text_area?: boolean;
            title?: string;
        };
    };
    response_type?: MessageResponseTypes;
    streaming_metadata?: {
        cancellable?: boolean;
        id?: string;
        stream_stopped?: boolean;
    };
    user_defined?: { [key: string]: {} };
}[]

An array of each user defined item partial chunk. Each chunk contains the new chunk information, they are not concatenated for you. When messageItem has been set an no more chunks are expected, this property is removed to avoid memory leaks.

Type declaration

  • Optionalagent_message_type?: AgentMessageType

    For messages that are sent between the user and a human agent, we assign an agent type to the message to distinguish what type it is.

  • Optionalmessage_options?: {
        chain_of_thought?: {
            description?: string;
            request?: { args?: {} };
            response?: { content?: {} };
            status?: ChainOfThoughtStepStatus;
            title?: string;
            tool_name?: string;
        }[];
        feedback?: {
            categories?: string[];
            disclaimer?: string;
            id?: string;
            is_on?: boolean;
            placeholder?: string;
            prompt?: string;
            show_negative_details?: boolean;
            show_positive_details?: boolean;
            show_prompt?: boolean;
            show_text_area?: boolean;
            title?: string;
        };
    }

    Options that control additional features available for a message item.

    • Optionalchain_of_thought?: {
          description?: string;
          request?: { args?: {} };
          response?: { content?: {} };
          status?: ChainOfThoughtStepStatus;
          title?: string;
          tool_name?: string;
      }[]

      Controls the display of chain of thought component. This API is in beta and is subject to change.

    • Optionalfeedback?: {
          categories?: string[];
          disclaimer?: string;
          id?: string;
          is_on?: boolean;
          placeholder?: string;
          prompt?: string;
          show_negative_details?: boolean;
          show_positive_details?: boolean;
          show_prompt?: boolean;
          show_text_area?: boolean;
          title?: string;
      }

      Controls the display of a feedback options (thumbs up/down) for a message item.

      • Optionalcategories?: string[]

        An optional set of categories to allow the user to choose from.

      • Optionaldisclaimer?: string

        The legal disclaimer text to show at the bottom of the popup. This text may contain rich markdown content. If this value is not provided, no text will be shown.

      • Optionalid?: string

        A unique identifier for this feedback. This is required for the feedback to be recorded in message history.

      • Optionalis_on?: boolean

        Indicates if a request for feedback should be displayed.

      • Optionalplaceholder?: string

        The placeholder to show in the text area. A default value will be used if no value is provided here.

      • Optionalprompt?: string

        The prompt text to display to the user. A default value will be used if no value is provided here.

      • Optionalshow_negative_details?: boolean

        Indicates if the user should be asked for additional detailed information when providing negative feedback. This defaults to true.

      • Optionalshow_positive_details?: boolean

        Indicates if the user should be asked for additional detailed information when providing positive feedback. This defaults to true.

      • Optionalshow_prompt?: boolean

        Indicates whether the prompt line should be shown. This defaults to true.

      • Optionalshow_text_area?: boolean

        Indicates whether the text area should be shown. This defaults to true.

      • Optionaltitle?: string

        The title to display in the popup. A default value will be used if no value is provided here.

  • Optionalresponse_type?: MessageResponseTypes

    The response type of this message item.

  • Optionalstreaming_metadata?: { cancellable?: boolean; id?: string; stream_stopped?: boolean }

    Metadata used identify a generic item within the context of a stream in order to correlate any updates meant for a specific item.

    • Optionalcancellable?: boolean

      When included on a partial_item, indicates if the stream can be cancelled. If so, a "stop streaming" button will display in the UI.

    • Optionalid?: string

      An identifier for this item within the full message response. This ID is used to correlate a partial or complete item chunk with other chunks that represent the same item. This ID is only unique for a given message response.

    • Optionalstream_stopped?: boolean

      Indicates if the stream has stopped which will trigger the UI to respond with appropriate a11y states and messaging.

  • Optionaluser_defined?: { [key: string]: {} }

    An optional buckets of additional user defined properties for this item.

MMNEPVFCICPMFPCPTTAAATR