abacusai.api_class.segments
===========================

.. py:module:: abacusai.api_class.segments


Attributes
----------

.. autoapisummary::

   abacusai.api_class.segments.Segment


Classes
-------

.. autoapisummary::

   abacusai.api_class.segments.Attachment
   abacusai.api_class.segments.ResponseSection
   abacusai.api_class.segments.AttachmentsResponseSection
   abacusai.api_class.segments.AgentFlowButtonResponseSection
   abacusai.api_class.segments.ImageUrlResponseSection
   abacusai.api_class.segments.TextResponseSection
   abacusai.api_class.segments.RuntimeSchemaResponseSection
   abacusai.api_class.segments.CodeResponseSection
   abacusai.api_class.segments.Base64ImageResponseSection
   abacusai.api_class.segments.CollapseResponseSection
   abacusai.api_class.segments.ListResponseSection
   abacusai.api_class.segments.ChartResponseSection


Module Contents
---------------

.. py:class:: Attachment

   Bases: :py:obj:`abacusai.api_class.abstract.ApiClass`


   An attachment that an agent can return to render attachments.

   :param filename: The name of the file.
   :type filename: str
   :param mime_type: The MIME type of the file.
   :type mime_type: str
   :param attachment_id: The ID of the attachment.
   :type attachment_id: str


   .. py:attribute:: filename
      :type:  str


   .. py:attribute:: mime_type
      :type:  str


   .. py:attribute:: attachment_id
      :type:  str


   .. py:method:: to_dict()

      Standardizes converting an ApiClass to dictionary.
      Keys of response dictionary are converted to camel case.
      This also validates the fields ( type, value, etc ) received in the dictionary.



   .. py:method:: from_dict(data)
      :classmethod:



.. py:class:: ResponseSection

   Bases: :py:obj:`abacusai.api_class.abstract.ApiClass`


   A response section that an agent can return to render specific UI elements.

   :param type: The type of the response.
   :type type: ResponseSectionType
   :param id: The section key of the segment.
   :type id: str


   .. py:attribute:: type
      :type:  abacusai.api_class.enums.ResponseSectionType


   .. py:attribute:: id
      :type:  str


   .. py:method:: to_dict()

      Standardizes converting an ApiClass to dictionary.
      Keys of response dictionary are converted to camel case.
      This also validates the fields ( type, value, etc ) received in the dictionary.



.. py:data:: Segment

.. py:class:: AttachmentsResponseSection(attachments, section_key = None)

   Bases: :py:obj:`ResponseSection`


   A response section that an agent can return to render attachments.

   :param attachments: The list of attachments to be displayed.
   :type attachments: List[Attachment]


   .. py:attribute:: attachments
      :type:  List[Attachment]


   .. py:method:: to_dict()

      Standardizes converting an ApiClass to dictionary.
      Keys of response dictionary are converted to camel case.
      This also validates the fields ( type, value, etc ) received in the dictionary.



   .. py:method:: from_dict(data)
      :classmethod:



.. py:class:: AgentFlowButtonResponseSection(label, agent_workflow_node_name, section_key = None)

   Bases: :py:obj:`ResponseSection`


   A response section that an AI Agent can return to render a button.

   :param label: The label of the button.
   :type label: str
   :param agent_workflow_node_name: The workflow start node to be executed when the button is clicked.
   :type agent_workflow_node_name: str


   .. py:attribute:: label
      :type:  str


   .. py:attribute:: agent_workflow_node_name
      :type:  str


.. py:class:: ImageUrlResponseSection(url, height, width, section_key = None)

   Bases: :py:obj:`ResponseSection`


   A response section that an agent can return to render an image.

   :param url: The url of the image to be displayed.
   :type url: str
   :param height: The height of the image.
   :type height: int
   :param width: The width of the image.
   :type width: int


   .. py:attribute:: url
      :type:  str


   .. py:attribute:: height
      :type:  int


   .. py:attribute:: width
      :type:  int


.. py:class:: TextResponseSection(text, section_key = None)

   Bases: :py:obj:`ResponseSection`


   A response section that an agent can return to render text.

   :param segment: The text to be displayed.
   :type segment: str


   .. py:attribute:: segment
      :type:  str


.. py:class:: RuntimeSchemaResponseSection(json_schema, ui_schema = None, schema_prop = None)

   Bases: :py:obj:`ResponseSection`


   A segment that an agent can return to render json and ui schema for workflow nodes.
   This is primarily to generate dynamic schema for subsequent workflow nodes.

   :param json_schema: json schema in RJSF format.
   :type json_schema: dict
   :param ui_schema: ui schema in RJSF format.
   :type ui_schema: dict


   .. py:attribute:: json_schema
      :type:  dict


   .. py:attribute:: ui_schema
      :type:  dict


.. py:class:: CodeResponseSection(code, language, section_key = None)

   Bases: :py:obj:`ResponseSection`


   A response section that an agent can return to render code.

   :param code: The code to be displayed.
   :type code: str
   :param language: The language of the code.
   :type language: CodeLanguage


   .. py:attribute:: code
      :type:  str


   .. py:attribute:: language
      :type:  abacusai.api_class.enums.CodeLanguage


.. py:class:: Base64ImageResponseSection(b64_image, section_key = None)

   Bases: :py:obj:`ResponseSection`


   A response section that an agent can return to render a base64 image.

   :param b64_image: The base64 image to be displayed.
   :type b64_image: str


   .. py:attribute:: b64_image
      :type:  str


.. py:class:: CollapseResponseSection(title, content, section_key = None)

   Bases: :py:obj:`ResponseSection`


   A response section that an agent can return to render a collapsible component.

   :param title: The title of the collapsible component.
   :type title: str
   :param content: The response section constituting the content of collapsible component
   :type content: ResponseSection


   .. py:attribute:: title
      :type:  str


   .. py:attribute:: content
      :type:  ResponseSection


   .. py:method:: to_dict()

      Standardizes converting an ApiClass to dictionary.
      Keys of response dictionary are converted to camel case.
      This also validates the fields ( type, value, etc ) received in the dictionary.



.. py:class:: ListResponseSection(items, section_key = None)

   Bases: :py:obj:`ResponseSection`


   A response section that an agent can return to render a list.

   :param items: The list items to be displayed.
   :type items: List[str]


   .. py:attribute:: items
      :type:  List[str]


.. py:class:: ChartResponseSection(chart, section_key = None)

   Bases: :py:obj:`ResponseSection`


   A response section that an agent can return to render a chart.

   :param chart: The chart to be displayed.
   :type chart: dict


   .. py:attribute:: chart
      :type:  dict


