abacusai.chat_session — AbacusAI documentation

# abacusai.chat_session

## Classes

`AiBuildingTask` | A task for Data Science Co-pilot to help build AI.
`ChatMessage` | A single chat message with Abacus Chat.
`AbstractApiClass` |
`ChatSession` | A chat session with Abacus Data Science Co-pilot.

## Module Contents

class abacusai.chat_session.AiBuildingTask(client, task=None, taskType=None)

  Bases: `abacusai.return_class.AbstractApiClass`

  A task for Data Science Co-pilot to help build AI.

  Parameters:

    - client (ApiClient) – An authenticated API Client instance

    - task (str) – The task to be performed

    - taskType (str) – The type of task

  __repr__()

    Return repr(self).

  to_dict()

    Get a dict representation of the parameters in this class

    Returns:

      The dict value representation of the class parameters

    Return type:

      dict

class abacusai.chat_session.ChatMessage(client, role=None, text=None, timestamp=None, isUseful=None, feedback=None, docIds=None, hotkeyTitle=None, tasks=None)

  Bases: `abacusai.return_class.AbstractApiClass`

  A single chat message with Abacus Chat.

  Parameters:

    - client (ApiClient) – An authenticated API Client instance

    - role (str) – The role of the message sender

    - text (list[dict]) – A list of text segments for the message

    - timestamp (str) – The timestamp at which the message was sent

    - isUseful (bool) – Whether this message was marked as useful or not

    - feedback (str) – The feedback provided for the message

    - docIds (list[str]) – A list of IDs of the uploaded document if the message has

    - hotkeyTitle (str) – The title of the hotkey prompt if the message has one

    - tasks (list[str]) – The list of spawned tasks, if the message was broken down into smaller sub-tasks.

  __repr__()

    Return repr(self).

  to_dict()

    Get a dict representation of the parameters in this class

    Returns:

      The dict value representation of the class parameters

    Return type:

      dict

class abacusai.chat_session.AbstractApiClass(client, id)
  __eq__(other)

    Return self==value.

  _get_attribute_as_dict(attribute)

class abacusai.chat_session.ChatSession(client, answer=None, chatSessionId=None, projectId=None, name=None, createdAt=None, status=None, aiBuildingInProgress=None, notification=None, whiteboard=None, chatHistory={}, nextAiBuildingTask={})

  Bases: `abacusai.return_class.AbstractApiClass`

  A chat session with Abacus Data Science Co-pilot.

  Parameters:

    - client (ApiClient) – An authenticated API Client instance

    - answer (str) – The response from the chatbot

    - chatSessionId (str) – The chat session id

    - projectId (str) – The project id associated with the chat session

    - name (str) – The name of the chat session

    - createdAt (str) – The timestamp at which the chat session was created

    - status (str) – The status of the chat sessions

    - aiBuildingInProgress (bool) – Whether the AI building is in progress or not

    - notification (str) – A warn/info message about the chat session. For example, a suggestion to create a new session if the current one is too old

    - whiteboard (str) – A set of whiteboard notes associated with the chat session

    - chatHistory (ChatMessage) – The chat history for the conversation

    - nextAiBuildingTask (AiBuildingTask) – The next AI building task for the chat session

  __repr__()

    Return repr(self).

  to_dict()

    Get a dict representation of the parameters in this class

    Returns:

      The dict value representation of the class parameters

    Return type:

      dict

  get()

    Gets a chat session from Data Science Co-pilot.

    Parameters:

      chat_session_id (str) – Unique ID of the chat session.

    Returns:

      The chat session with Data Science Co-pilot

    Return type:

      ChatSession

  delete_chat_message(message_index)

    Deletes a message in a chat session and its associated response.

    Parameters:

      message_index (int) – The index of the chat message within the UI.

  export()

    Exports a chat session to an HTML file

    Parameters:

      chat_session_id (str) – Unique ID of the chat session.

  rename(name)

    Renames a chat session with Data Science Co-pilot.

    Parameters:

      name (str) – The new name of the chat session.