abacusai.agent
==============

.. py:module:: abacusai.agent


Classes
-------

.. autoapisummary::

   abacusai.agent.AgentVersion
   abacusai.agent.WorkflowGraph
   abacusai.agent.CodeSource
   abacusai.agent.AbstractApiClass
   abacusai.agent.Agent


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

.. py:class:: AgentVersion(client, agentVersion=None, status=None, agentId=None, agentConfig=None, publishingStartedAt=None, publishingCompletedAt=None, pendingDeploymentIds=None, failedDeploymentIds=None, error=None, agentExecutionConfig=None, codeSource={}, workflowGraph={})

   Bases: :py:obj:`abacusai.return_class.AbstractApiClass`


   A version of an AI agent.

   :param client: An authenticated API Client instance
   :type client: ApiClient
   :param agentVersion: The unique identifier of an agent version.
   :type agentVersion: str
   :param status: The current status of the model.
   :type status: str
   :param agentId: A reference to the agent this version belongs to.
   :type agentId: str
   :param agentConfig: The config options used to create this agent.
   :type agentConfig: dict
   :param publishingStartedAt: The start time and date of the training process in ISO-8601 format.
   :type publishingStartedAt: str
   :param publishingCompletedAt: The end time and date of the training process in ISO-8601 format.
   :type publishingCompletedAt: str
   :param pendingDeploymentIds: List of deployment IDs where deployment is pending.
   :type pendingDeploymentIds: list
   :param failedDeploymentIds: List of failed deployment IDs.
   :type failedDeploymentIds: list
   :param error: Relevant error if the status is FAILED.
   :type error: str
   :param agentExecutionConfig: The config for arguments used to execute the agent.
   :type agentExecutionConfig: dict
   :param codeSource: If a python model, information on where the source code is located.
   :type codeSource: CodeSource
   :param workflowGraph: The workflow graph for the agent.
   :type workflowGraph: WorkflowGraph


   .. py:method:: __repr__()

      Return repr(self).



   .. py:method:: to_dict()

      Get a dict representation of the parameters in this class

      :returns: The dict value representation of the class parameters
      :rtype: dict



   .. py:method:: refresh()

      Calls describe and refreshes the current object's fields

      :returns: The current object
      :rtype: AgentVersion



   .. py:method:: describe()

      Retrieves a full description of the specified agent version.

      :param agent_version: Unique string identifier of the agent version.
      :type agent_version: str

      :returns: A agent version.
      :rtype: AgentVersion



   .. py:method:: wait_for_publish(timeout=None)

      A waiting call until agent gets published.

      :param timeout: The waiting time given to the call to finish, if it doesn't finish by the allocated time, the call is said to be timed out.
      :type timeout: int



   .. py:method:: get_status()

      Gets the status of the model version under training.

      :returns: A string describing the status of a model training (pending, complete, etc.).
      :rtype: str



.. py:class:: WorkflowGraph

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


   An Agent workflow graph. The edges define the node invokation order. The workflow must follow linear invokation order.

   :param nodes: A list of nodes in the workflow graph.
   :type nodes: List[WorkflowGraphNode]
   :param edges: A list of edges in the workflow graph, where each edge is a tuple of source, target and details.
   :type edges: List[WorkflowGraphEdge]


   .. py:attribute:: nodes
      :type:  List[WorkflowGraphNode]


   .. py:attribute:: edges
      :type:  List[WorkflowGraphEdge]


   .. 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(graph)
      :classmethod:



.. py:class:: CodeSource(client, sourceType=None, sourceCode=None, applicationConnectorId=None, applicationConnectorInfo=None, packageRequirements=None, status=None, error=None, publishingMsg=None, moduleDependencies=None)

   Bases: :py:obj:`abacusai.return_class.AbstractApiClass`


   Code source for python-based custom feature groups and models

   :param client: An authenticated API Client instance
   :type client: ApiClient
   :param sourceType: The type of the source, one of TEXT, PYTHON, FILE_UPLOAD, or APPLICATION_CONNECTOR
   :type sourceType: str
   :param sourceCode: If the type of the source is TEXT, the raw text of the function
   :type sourceCode: str
   :param applicationConnectorId: The Application Connector to fetch the code from
   :type applicationConnectorId: str
   :param applicationConnectorInfo: Args passed to the application connector to fetch the code
   :type applicationConnectorInfo: str
   :param packageRequirements: The pip package dependencies required to run the code
   :type packageRequirements: list
   :param status: The status of the code and validations
   :type status: str
   :param error: If the status is failed, an error message describing what went wrong
   :type error: str
   :param publishingMsg: Warnings in the source code
   :type publishingMsg: dict
   :param moduleDependencies: The list of internal modules dependencies required to run the code
   :type moduleDependencies: list


   .. py:method:: __repr__()

      Return repr(self).



   .. py:method:: to_dict()

      Get a dict representation of the parameters in this class

      :returns: The dict value representation of the class parameters
      :rtype: dict



   .. py:method:: import_as_cell()

      Adds the source code as an unexecuted cell in the notebook.



.. py:class:: AbstractApiClass(client, id)

   .. py:method:: __eq__(other)

      Return self==value.



   .. py:method:: _get_attribute_as_dict(attribute)


.. py:class:: Agent(client, name=None, agentId=None, createdAt=None, projectId=None, notebookId=None, predictFunctionName=None, sourceCode=None, agentConfig=None, memory=None, trainingRequired=None, agentExecutionConfig=None, codeSource={}, latestAgentVersion={}, workflowGraph={})

   Bases: :py:obj:`abacusai.return_class.AbstractApiClass`


   An AI agent.

   :param client: An authenticated API Client instance
   :type client: ApiClient
   :param name: The user-friendly name for the agent.
   :type name: str
   :param agentId: The unique identifier of the agent.
   :type agentId: str
   :param createdAt: Date and time at which the agent was created.
   :type createdAt: str
   :param projectId: The project this agent belongs to.
   :type projectId: str
   :param notebookId: The notebook associated with the agent.
   :type notebookId: str
   :param predictFunctionName: Name of the function found in the source code that will be executed run predictions through agent. It is not executed when this function is run.
   :type predictFunctionName: str
   :param sourceCode: Python code used to make the agent.
   :type sourceCode: str
   :param agentConfig: The config options used to create this agent.
   :type agentConfig: dict
   :param memory: Memory in GB specified for the deployment resources for the agent.
   :type memory: int
   :param trainingRequired: Whether training is required to deploy the latest agent code.
   :type trainingRequired: bool
   :param agentExecutionConfig: The config for arguments used to execute the agent.
   :type agentExecutionConfig: dict
   :param latestAgentVersion: The latest agent version.
   :type latestAgentVersion: AgentVersion
   :param codeSource: If a python model, information on the source code
   :type codeSource: CodeSource
   :param workflowGraph: The workflow graph for the agent.
   :type workflowGraph: WorkflowGraph


   .. py:method:: __repr__()

      Return repr(self).



   .. py:method:: to_dict()

      Get a dict representation of the parameters in this class

      :returns: The dict value representation of the class parameters
      :rtype: dict



   .. py:method:: refresh()

      Calls describe and refreshes the current object's fields

      :returns: The current object
      :rtype: Agent



   .. py:method:: describe()

      Retrieves a full description of the specified model.

      :param agent_id: Unique string identifier associated with the model.
      :type agent_id: str

      :returns: Description of the agent.
      :rtype: Agent



   .. py:method:: list_versions(limit = 100, start_after_version = None)

      List all versions of an agent.

      :param limit: If provided, limits the number of agent versions returned.
      :type limit: int
      :param start_after_version: Unique string identifier of the version after which the list starts.
      :type start_after_version: str

      :returns: An array of Agent versions.
      :rtype: list[AgentVersion]



   .. py:method:: wait_for_publish(timeout=None)

      A waiting call until agent is published.

      :param timeout: The waiting time given to the call to finish, if it doesn't finish by the allocated time, the call is said to be timed out.
      :type timeout: int



   .. py:method:: get_status()

      Gets the status of the agent publishing.

      :returns: A string describing the status of a agent publishing (pending, complete, etc.).
      :rtype: str



