Interface PartialItemChunk

The interface for a chunk that represents a partial update (or first time chunk) to a message item.

interface PartialItemChunk {
    partial_item: {
        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]: {} };
    };
    streaming_metadata?: { response_id: string };
}

Hierarchy (View Summary, Expand)

Properties

partial_item: {
    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]: {} };
}

The partial details of the item. The client will decide what rules to follow for merging this in with any existing data for the same item (which is identified using the ItemStreamingMetadata.id property).

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.

streaming_metadata?: { response_id: string }

Additional metadata associated with the stream.

Type declaration

  • response_id: string

    The ID of the complete message response object. This ID will be the ID of the full message that is received in the final chunk of the stream.

MMNEPVFCICPMFPCPTTAAATR