abacusai.api_class.ai_agents — AbacusAI documentation

# `abacusai.api_class.ai_agents`

## Module Contents

### Classes

`FieldDescriptor` | Configs for vector store indexing.
`WorkflowNodeInputMapping` | A mapping of input to a workflow node.
`WorkflowNodeOutputMapping` | A mapping of output to a workflow node.
`WorkflowGraphNode` | A node in an Agent workflow graph.
`WorkflowGraphEdge` | An edge in an Agent workflow graph.
`WorkflowGraph` | An Agent workflow graph.

class abacusai.api_class.ai_agents.FieldDescriptor

  Bases: `abacusai.api_class.abstract.ApiClass`

  Configs for vector store indexing.

  Parameters:

    - field (str) – The field to be extracted. This will be used as the key in the response.

    - description (str) – The description of this field. If not included, the response_field will be used.

    - example_extraction (Union[str, int, bool, float]) – An example of this extracted field.

    - type (enums.FieldDescriptorType) – The type of this field. If not provided, the default type is STRING.

  field: str
  description: str
  example_extraction: str | int | bool | float | list | dict
  type: abacusai.api_class.enums.FieldDescriptorType

class abacusai.api_class.ai_agents.WorkflowNodeInputMapping

  Bases: `abacusai.api_class.abstract.ApiClass`

  A mapping of input to a workflow node.

  Parameters:

    - name (str) – The name of the input.

    - variable_type (str) – The type of the input.

    - workflow_variable_source (str) – The workflow source stage of the input.

    - is_required (bool) – Whether the input is required.

  name: str
  variable_type: abacusai.api_class.enums.WorkflowNodeInputType
  workflow_variable_source: str
  is_required: bool
  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.ai_agents.WorkflowNodeOutputMapping

  Bases: `abacusai.api_class.abstract.ApiClass`

  A mapping of output to a workflow node.

  Parameters:

    - name (str) – The name of the output.

    - variable_type (str) – The type of the output.

  name: str
  variable_type: abacusai.api_class.enums.WorkflowNodeOutputType
  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.ai_agents.WorkflowGraphNode(name, input_mappings, output_mappings, function=None, function_name=None, source_code=None, input_schema=None, output_schema=None, package_requirements=None)

  Bases: `abacusai.api_class.abstract.ApiClass`

  A node in an Agent workflow graph.

  Parameters:

    - name (str) – Display name of the worflow node.

    - input_mappings (List[WorkflowNodeInputMapping]) – List of input mappings for the node.

    - output_mappings (List[WorkflowNodeOutputMapping]) – List of output mappings for the node.

    - function (callable) – The callable node function reference if available.

    - function_name (str) – The name of the function if available.

    - source_code (str) – The source code of the function if available.

    - input_schema (dict) – The react json schema for the input form if applicable.

    - output_schema (dict) – The react json schema for the output if applicable.

    - package_requirements (list) – List of package requirements for the node.

  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(node)
    Parameters:

      node (dict) –

class abacusai.api_class.ai_agents.WorkflowGraphEdge

  Bases: `abacusai.api_class.abstract.ApiClass`

  An edge in an Agent workflow graph.

  Parameters:

    - source (str) – The source node of the edge.

    - target (str) – The target node of the edge.

    - details (dict) – Additional details about the edge.

  source: str
  target: str
  details: dict
  to_nx_edge()

class abacusai.api_class.ai_agents.WorkflowGraph

  Bases: `abacusai.api_class.abstract.ApiClass`

  An Agent workflow graph.

  Parameters:

    - nodes (List[WorkflowGraphNode]) – A list of nodes in the workflow graph.

    - edges (List[WorkflowGraphEdge]) – A list of edges in the workflow graph, where each edge is a tuple of source, target and details.

  nodes: List[WorkflowGraphNode]
  edges: List[WorkflowGraphEdge]
  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(graph)
    Parameters:

      graph (dict) –