abacusai.api_class.segments — AbacusAI documentation

# abacusai.api_class.segments

## Classes

`Attachment` | An attachment that an agent can return to render attachments.
`Segment` | A segment that an agent can return to render specific UI elements.
`AttachmentsSegment` | A segment that an agent can return to render attachments.
`AgentFlowButtonSegment` | A segment that an AI Agent can return to render a button.
`ImageUrlSegment` | A segment that an agent can return to render an image.
`TextSegment` | A segment that an agent can return to render text.

## Module Contents

class abacusai.api_class.segments.Attachment

  Bases: `abacusai.api_class.abstract.ApiClass`

  An attachment that an agent can return to render attachments.

  Parameters:

    - filename (str) – The name of the file.

    - mime_type (str) – The MIME type of the file.

    - attachment_id (str) – The ID of the attachment.

  filename: str
  mime_type: str
  attachment_id: str
  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.

  classmethod from_dict(data)
    Parameters:

      data (dict)

class abacusai.api_class.segments.Segment

  Bases: `abacusai.api_class.abstract.ApiClass`

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

  Parameters:

    - type (SegmentType) – The type of the segment.

    - id (str) – The section key of the segment.

  type: abacusai.api_class.enums.SegmentType
  id: str
  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.

class abacusai.api_class.segments.AttachmentsSegment(attachments, section_key=None)

  Bases: `Segment`

  A segment that an agent can return to render attachments.

  Parameters:

    - attachments (List[Attachment]) – The list of attachments to be displayed.

    - section_key (str)

  attachments: List[Attachment]
  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.

  classmethod from_dict(data)
    Parameters:

      data (dict)

class abacusai.api_class.segments.AgentFlowButtonSegment(label, agent_workflow_node_name, section_key=None)

  Bases: `Segment`

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

  Parameters:

    - label (str) – The label of the button.

    - agent_workflow_node_name (str) – The workflow start node to be executed when the button is clicked.

    - section_key (str)

  label: str
  agent_workflow_node_name: str

class abacusai.api_class.segments.ImageUrlSegment(url, section_key=None)

  Bases: `Segment`

  A segment that an agent can return to render an image.

  Parameters:

    - segment (str) – The url of the image to be displayed.

    - url (str)

    - section_key (str)

  segment: str

class abacusai.api_class.segments.TextSegment(text, section_key=None)

  Bases: `Segment`

  A segment that an agent can return to render text.

  Parameters:

    - segment (str) – The text to be displayed.

    - text (str)

    - section_key (str)

  segment: str