abacusai.api_class.ai_agents
Module Contents
Classes
Configs for vector store indexing. |
|
A react-jsonschema-form conformant schema for workflow node input. |
|
A react-jsonschema-form schema for a workflow node output. |
|
A mapping of input to a workflow node. |
|
A mapping of output to a workflow node. |
|
A node in an Agent workflow graph. |
|
An edge in an Agent workflow graph. |
|
An Agent workflow graph. The edges define the node invokation order. The workflow must follow linear invokation order. |
- 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 (FieldDescriptorType) – The type of this field. If not provided, the default type is STRING.
- class abacusai.api_class.ai_agents.WorkflowNodeInputSchema
Bases:
abacusai.api_class.abstract.ApiClass
A react-jsonschema-form conformant schema for workflow node input.
- Parameters:
- 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.WorkflowNodeOutputSchema
Bases:
abacusai.api_class.abstract.ApiClass
A react-jsonschema-form schema for a workflow node output.
- Parameters:
json_schema (dict) – The json schema for the output conformant to react-jsonschema-form specification.
- 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.WorkflowNodeInputMapping
Bases:
abacusai.api_class.abstract.ApiClass
A mapping of input to a workflow node.
- Parameters:
name (str) – The name of the input variable of the node function.
variable_type (WorkflowNodeInputType) – The type of the input.
variable_source (str) – The name of the node this variable is sourced from. If the type is WORKFLOW_VARIABLE, the value given by the source node will be directly used. If the type is USER_INPUT, the value given by the source node will be used as the default initial value before user edits it. Set to None if the type is USER_INPUT and the variable doesn’t need a pre-filled initial value.
is_required (bool) – Whether the input is required. Defaults to True
- variable_type: abacusai.api_class.enums.WorkflowNodeInputType
- 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 (WorkflowNodeOutputType) – The type of the output.
- 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) – A unique name for the workflow node.
input_mappings (List[WorkflowNodeInputMapping]) – List of input mappings for the node. Each arg/kwarg of the node function should have a corresponding input mapping.
output_mappings (List[WorkflowNodeOutputMapping]) – List of output mappings for the node. Each field in the returned dict/AgentResponse must have a corresponding output mapping.
function (callable) – The callable node function reference.
input_schema (WorkflowNodeInputSchema) – The react json schema for the user input variables.
output_schema (WorkflowNodeOutputSchema) – The react json schema for the output to be shown on UI.
package_requirements (list) – List of package requirements for the node.
function_name (str)
source_code (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.ai_agents.WorkflowGraphEdge
Bases:
abacusai.api_class.abstract.ApiClass
An edge in an Agent workflow graph.
- Parameters:
- to_nx_edge()
- class abacusai.api_class.ai_agents.WorkflowGraph
Bases:
abacusai.api_class.abstract.ApiClass
An Agent workflow graph. The edges define the node invokation order. The workflow must follow linear invokation order.
- 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.