abacusai.agent

Classes

Agent

An AI agent.

Module Contents

class abacusai.agent.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={}, draftWorkflowGraph={}, workflowGraph={})

Bases: abacusai.return_class.AbstractApiClass

An AI agent.

Parameters:
  • client (ApiClient) – An authenticated API Client instance

  • name (str) – The user-friendly name for the agent.

  • agentId (str) – The unique identifier of the agent.

  • createdAt (str) – Date and time at which the agent was created.

  • projectId (str) – The project this agent belongs to.

  • notebookId (str) – The notebook associated with the agent.

  • predictFunctionName (str) – 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.

  • sourceCode (str) – Python code used to make the agent.

  • agentConfig (dict) – The config options used to create this agent.

  • memory (int) – Memory in GB specified for the deployment resources for the agent.

  • trainingRequired (bool) – Whether training is required to deploy the latest agent code.

  • agentExecutionConfig (dict) – The config for arguments used to execute the agent.

  • latestAgentVersion (AgentVersion) – The latest agent version.

  • codeSource (CodeSource) – If a python model, information on the source code

  • draftWorkflowGraph (WorkflowGraph) – The saved draft state of the workflow graph for the agent.

  • workflowGraph (WorkflowGraph) – The workflow graph for the agent.

name
agent_id
created_at
project_id
notebook_id
predict_function_name
source_code
agent_config
memory
training_required
agent_execution_config
code_source
latest_agent_version
draft_workflow_graph
workflow_graph
deprecated_keys
__repr__()
to_dict()

Get a dict representation of the parameters in this class

Returns:

The dict value representation of the class parameters

Return type:

dict

refresh()

Calls describe and refreshes the current object’s fields

Returns:

The current object

Return type:

Agent

describe()

Retrieves a full description of the specified model.

Parameters:

agent_id (str) – Unique string identifier associated with the model.

Returns:

Description of the agent.

Return type:

Agent

list_versions(limit=100, start_after_version=None)

List all versions of an agent.

Parameters:
  • limit (int) – If provided, limits the number of agent versions returned.

  • start_after_version (str) – Unique string identifier of the version after which the list starts.

Returns:

An array of Agent versions.

Return type:

list[AgentVersion]

property description: str

The description of the agent.

Return type:

str

property agent_interface: str

The interface that the agent will be deployed with.

Return type:

str

property agent_connectors: dict

A dictionary mapping ApplicationConnectorType keys to lists of OAuth scopes. Each key represents a specific application connector, while the value is a list of scopes that define the permissions granted to the application.

Return type:

dict

wait_for_publish(timeout=None)

A waiting call until agent is published.

Parameters:

timeout (int) – 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.

get_status()

Gets the status of the agent publishing.

Returns:

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

Return type:

str

republish()

Re-publishes the Agent and creates a new Agent Version.

Returns:

The new Agent Version.

Return type:

AgentVersion