Skip to content

Commit b073652

Browse files
committed
Version 1.4.19
1 parent 725d199 commit b073652

File tree

281 files changed

+8506
-4151
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

281 files changed

+8506
-4151
lines changed

abacusai/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -221,4 +221,4 @@
221221
from .workflow_node_template import WorkflowNodeTemplate
222222

223223

224-
__version__ = "1.4.18"
224+
__version__ = "1.4.19"

abacusai/agent.py

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,10 @@ class Agent(AbstractApiClass):
2323
agentExecutionConfig (dict): The config for arguments used to execute the agent.
2424
latestAgentVersion (AgentVersion): The latest agent version.
2525
codeSource (CodeSource): If a python model, information on the source code
26-
draftWorkflowGraph (WorkflowGraph): The last saved draft of workflow graph for the agent.
2726
workflowGraph (WorkflowGraph): The workflow graph for the agent.
2827
"""
2928

30-
def __init__(self, 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={}):
29+
def __init__(self, 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={}):
3130
super().__init__(client, agentId)
3231
self.name = name
3332
self.agent_id = agentId
@@ -43,14 +42,12 @@ def __init__(self, client, name=None, agentId=None, createdAt=None, projectId=No
4342
self.code_source = client._build_class(CodeSource, codeSource)
4443
self.latest_agent_version = client._build_class(
4544
AgentVersion, latestAgentVersion)
46-
self.draft_workflow_graph = client._build_class(
47-
WorkflowGraph, draftWorkflowGraph)
4845
self.workflow_graph = client._build_class(WorkflowGraph, workflowGraph)
4946
self.deprecated_keys = {}
5047

5148
def __repr__(self):
52-
repr_dict = {f'name': repr(self.name), f'agent_id': repr(self.agent_id), f'created_at': repr(self.created_at), f'project_id': repr(self.project_id), f'notebook_id': repr(self.notebook_id), f'predict_function_name': repr(self.predict_function_name), f'source_code': repr(self.source_code), f'agent_config': repr(self.agent_config), f'memory': repr(
53-
self.memory), f'training_required': repr(self.training_required), f'agent_execution_config': repr(self.agent_execution_config), f'code_source': repr(self.code_source), f'latest_agent_version': repr(self.latest_agent_version), f'draft_workflow_graph': repr(self.draft_workflow_graph), f'workflow_graph': repr(self.workflow_graph)}
49+
repr_dict = {f'name': repr(self.name), f'agent_id': repr(self.agent_id), f'created_at': repr(self.created_at), f'project_id': repr(self.project_id), f'notebook_id': repr(self.notebook_id), f'predict_function_name': repr(self.predict_function_name), f'source_code': repr(self.source_code), f'agent_config': repr(
50+
self.agent_config), f'memory': repr(self.memory), f'training_required': repr(self.training_required), f'agent_execution_config': repr(self.agent_execution_config), f'code_source': repr(self.code_source), f'latest_agent_version': repr(self.latest_agent_version), f'workflow_graph': repr(self.workflow_graph)}
5451
class_name = "Agent"
5552
repr_str = ',\n '.join([f'{key}={value}' for key, value in repr_dict.items(
5653
) if getattr(self, key, None) is not None and key not in self.deprecated_keys])
@@ -63,8 +60,8 @@ def to_dict(self):
6360
Returns:
6461
dict: The dict value representation of the class parameters
6562
"""
66-
resp = {'name': self.name, 'agent_id': self.agent_id, 'created_at': self.created_at, 'project_id': self.project_id, 'notebook_id': self.notebook_id, 'predict_function_name': self.predict_function_name, 'source_code': self.source_code, 'agent_config': self.agent_config, 'memory': self.memory, 'training_required': self.training_required,
67-
'agent_execution_config': self.agent_execution_config, 'code_source': self._get_attribute_as_dict(self.code_source), 'latest_agent_version': self._get_attribute_as_dict(self.latest_agent_version), 'draft_workflow_graph': self._get_attribute_as_dict(self.draft_workflow_graph), 'workflow_graph': self._get_attribute_as_dict(self.workflow_graph)}
63+
resp = {'name': self.name, 'agent_id': self.agent_id, 'created_at': self.created_at, 'project_id': self.project_id, 'notebook_id': self.notebook_id, 'predict_function_name': self.predict_function_name, 'source_code': self.source_code, 'agent_config': self.agent_config, 'memory': self.memory,
64+
'training_required': self.training_required, 'agent_execution_config': self.agent_execution_config, 'code_source': self._get_attribute_as_dict(self.code_source), 'latest_agent_version': self._get_attribute_as_dict(self.latest_agent_version), 'workflow_graph': self._get_attribute_as_dict(self.workflow_graph)}
6865
return {key: value for key, value in resp.items() if value is not None and key not in self.deprecated_keys}
6966

7067
def refresh(self):

abacusai/api_class/ai_agents.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -356,7 +356,7 @@ def _raw_init(cls, name: str, input_mappings: List[WorkflowNodeInputMapping] = N
356356
return workflow_node
357357

358358
@classmethod
359-
def from_template(cls, template_name: str, name: str, configs: dict = None, input_mappings: Union[Dict[str, WorkflowNodeInputMapping], List[WorkflowNodeInputMapping]] = None, input_schema: Union[List[str], WorkflowNodeInputSchema] = None, output_schema: Union[List[str], WorkflowNodeOutputSchema] = None):
359+
def from_template(cls, template_name: str, name: str, configs: dict = None, input_mappings: Union[Dict[str, WorkflowNodeInputMapping], List[WorkflowNodeInputMapping]] = None, input_schema: Union[List[str], WorkflowNodeInputSchema] = None, output_schema: Union[List[str], WorkflowNodeOutputSchema] = None, sleep_time: int = None):
360360

361361
instance_input_mappings = []
362362
if isinstance(input_mappings, List) and all(isinstance(input, WorkflowNodeInputMapping) for input in input_mappings):
@@ -396,7 +396,8 @@ def from_template(cls, template_name: str, name: str, configs: dict = None, inpu
396396
template_metadata={
397397
'template_name': template_name,
398398
'configs': configs or {},
399-
'initialized': False
399+
'initialized': False,
400+
'sleep_time': sleep_time,
400401
}
401402
)
402403

abacusai/api_class/dataset.py

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,12 +59,14 @@ class DocumentProcessingConfig(ApiClass):
5959

6060
def __post_init__(self):
6161
self.ocr_mode = self._detect_ocr_mode()
62+
if self.document_type is not None and DocumentType.is_ocr_forced(self.document_type):
63+
self.highlight_relevant_text = True
6264
if self.highlight_relevant_text is not None:
6365
self.extract_bounding_boxes = self.highlight_relevant_text # Highlight_relevant text acts as a wrapper over extract_bounding_boxes
6466

6567
def _detect_ocr_mode(self):
6668
if self.document_type is not None:
67-
if self.document_type == DocumentType.TEXT:
69+
if self.document_type == DocumentType.TEXT or self.document_type == DocumentType.SIMPLE_TEXT:
6870
return OcrMode.DEFAULT
6971
elif self.document_type == DocumentType.TABLES_AND_FORMS:
7072
return OcrMode.LAYOUT
@@ -76,6 +78,15 @@ def _detect_ocr_mode(self):
7678
return self.ocr_mode
7779
return OcrMode.AUTO
7880

81+
@classmethod
82+
def _get_filtered_dict(cls, config: dict):
83+
"""Filters out default values from the config"""
84+
from reainternal.utils import snake_case
85+
return {
86+
k: v for k, v in config.items()
87+
if v is not None and v != getattr(cls, snake_case(k), None)
88+
}
89+
7990

8091
@dataclasses.dataclass
8192
class DatasetDocumentProcessingConfig(DocumentProcessingConfig):

abacusai/api_class/enums.py

Lines changed: 20 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -405,9 +405,9 @@ class ApplicationConnectorType(ApiEnum):
405405
GOOGLEDRIVEUSER = 'GOOGLEDRIVEUSER'
406406
GOOGLEWORKSPACEUSER = 'GOOGLEWORKSPACEUSER'
407407
GMAILUSER = 'GMAILUSER'
408-
GOOGLECALENDARUSER = 'GOOGLECALENDARUSER'
409-
GOOGLESHEETSUSER = 'GOOGLESHEETSUSER'
410-
GOOGLEDOCSUSER = 'GOOGLEDOCSUSER'
408+
GOOGLECALENDAR = 'GOOGLECALENDAR'
409+
GOOGLESHEETS = 'GOOGLESHEETS'
410+
GOOGLEDOCS = 'GOOGLEDOCS'
411411
ONEDRIVEUSER = 'ONEDRIVEUSER'
412412
TEAMSSCRAPER = 'TEAMSSCRAPER'
413413
GITHUBUSER = 'GITHUBUSER'
@@ -482,6 +482,7 @@ class LLMName(ApiEnum):
482482
GEMINI_1_5_PRO = 'GEMINI_1_5_PRO'
483483
ABACUS_SMAUG3 = 'ABACUS_SMAUG3'
484484
ABACUS_DRACARYS = 'ABACUS_DRACARYS'
485+
QWEN_2_5_32B = 'QWEN_2_5_32B'
485486
GEMINI_1_5_FLASH = 'GEMINI_1_5_FLASH'
486487

487488

@@ -608,10 +609,15 @@ def aws_ocr_modes(cls):
608609

609610

610611
class DocumentType(ApiEnum):
611-
TEXT = 'TEXT'
612-
TABLES_AND_FORMS = 'TABLES_AND_FORMS'
613-
EMBEDDED_IMAGES = 'EMBEDDED_IMAGES'
614-
SCANNED_TEXT = 'SCANNED_TEXT'
612+
SIMPLE_TEXT = 'SIMPLE_TEXT' # digital text
613+
TEXT = 'TEXT' # general text with OCR
614+
TABLES_AND_FORMS = 'TABLES_AND_FORMS' # tables and forms with OCR
615+
EMBEDDED_IMAGES = 'EMBEDDED_IMAGES' # embedded images with OCR TODO: remove?
616+
SCANNED_TEXT = 'SCANNED_TEXT' # scanned text with OCR
617+
618+
@classmethod
619+
def is_ocr_forced(cls, document_type: 'DocumentType'):
620+
return document_type in [cls.TEXT, cls.TABLES_AND_FORMS, cls.EMBEDDED_IMAGES, cls.SCANNED_TEXT]
615621

616622

617623
class StdDevThresholdType(ApiEnum):
@@ -641,6 +647,11 @@ class AgentInterface(ApiEnum):
641647
AUTONOMOUS = 'AUTONOMOUS'
642648

643649

650+
class WorkflowNodeTemplateType(ApiEnum):
651+
TRIGGER = 'trigger'
652+
DEFAULT = 'default'
653+
654+
644655
class ProjectConfigType(ApiEnum):
645656
CONSTRAINTS = 'CONSTRAINTS'
646657
CHAT_FEEDBACK = 'CHAT_FEEDBACK'
@@ -693,3 +704,5 @@ class DeploymentConversationType(ApiEnum):
693704
COMPLEX_AGENT = 'COMPLEX_AGENT'
694705
WORKFLOW_AGENT = 'WORKFLOW_AGENT'
695706
COPILOT = 'COPILOT'
707+
AGENT_CONTROLLER = 'AGENT_CONTROLLER'
708+
CODE_LLM = 'CODE_LLM'

abacusai/api_key.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,25 +11,27 @@ class ApiKey(AbstractApiClass):
1111
apiKey (str): The unique API key scoped to a specific organization. Value will be partially obscured.
1212
apiKeySuffix (str): The last 4 characters of the API key.
1313
tag (str): A user-friendly tag for the API key.
14+
type (str): The type of the API key, either 'default' or 'code-llm'.
1415
createdAt (str): The timestamp when the API key was created.
1516
expiresAt (str): The timestamp when the API key will expire.
1617
isExpired (bool): Whether the API key has expired.
1718
"""
1819

19-
def __init__(self, client, apiKeyId=None, apiKey=None, apiKeySuffix=None, tag=None, createdAt=None, expiresAt=None, isExpired=None):
20+
def __init__(self, client, apiKeyId=None, apiKey=None, apiKeySuffix=None, tag=None, type=None, createdAt=None, expiresAt=None, isExpired=None):
2021
super().__init__(client, apiKeyId)
2122
self.api_key_id = apiKeyId
2223
self.api_key = apiKey
2324
self.api_key_suffix = apiKeySuffix
2425
self.tag = tag
26+
self.type = type
2527
self.created_at = createdAt
2628
self.expires_at = expiresAt
2729
self.is_expired = isExpired
2830
self.deprecated_keys = {}
2931

3032
def __repr__(self):
3133
repr_dict = {f'api_key_id': repr(self.api_key_id), f'api_key': repr(self.api_key), f'api_key_suffix': repr(self.api_key_suffix), f'tag': repr(
32-
self.tag), f'created_at': repr(self.created_at), f'expires_at': repr(self.expires_at), f'is_expired': repr(self.is_expired)}
34+
self.tag), f'type': repr(self.type), f'created_at': repr(self.created_at), f'expires_at': repr(self.expires_at), f'is_expired': repr(self.is_expired)}
3335
class_name = "ApiKey"
3436
repr_str = ',\n '.join([f'{key}={value}' for key, value in repr_dict.items(
3537
) if getattr(self, key, None) is not None and key not in self.deprecated_keys])
@@ -42,8 +44,8 @@ def to_dict(self):
4244
Returns:
4345
dict: The dict value representation of the class parameters
4446
"""
45-
resp = {'api_key_id': self.api_key_id, 'api_key': self.api_key, 'api_key_suffix': self.api_key_suffix,
46-
'tag': self.tag, 'created_at': self.created_at, 'expires_at': self.expires_at, 'is_expired': self.is_expired}
47+
resp = {'api_key_id': self.api_key_id, 'api_key': self.api_key, 'api_key_suffix': self.api_key_suffix, 'tag': self.tag,
48+
'type': self.type, 'created_at': self.created_at, 'expires_at': self.expires_at, 'is_expired': self.is_expired}
4749
return {key: value for key, value in resp.items() if value is not None and key not in self.deprecated_keys}
4850

4951
def delete(self):

abacusai/batch_prediction.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ def __init__(self, client, batchPredictionId=None, createdAt=None, name=None, de
8484
BatchPredictionArgs, globalPredictionArgs)
8585
self.batch_prediction_args = client._build_class(getattr(
8686
api_class, batchPredictionArgsType, BatchPredictionArgs) if batchPredictionArgsType else BatchPredictionArgs, batchPredictionArgs)
87-
self.deprecated_keys = {'global_prediction_args', 'explanations'}
87+
self.deprecated_keys = {'explanations', 'global_prediction_args'}
8888

8989
def __repr__(self):
9090
repr_dict = {f'batch_prediction_id': repr(self.batch_prediction_id), f'created_at': repr(self.created_at), f'name': repr(self.name), f'deployment_id': repr(self.deployment_id), f'file_connector_output_location': repr(self.file_connector_output_location), f'database_connector_id': repr(self.database_connector_id), f'database_output_configuration': repr(self.database_output_configuration), f'file_output_format': repr(self.file_output_format), f'connector_type': repr(self.connector_type), f'legacy_input_location': repr(self.legacy_input_location), f'output_feature_group_id': repr(self.output_feature_group_id), f'feature_group_table_name': repr(self.feature_group_table_name), f'output_feature_group_table_name': repr(self.output_feature_group_table_name), f'summary_feature_group_table_name': repr(self.summary_feature_group_table_name), f'csv_input_prefix': repr(

abacusai/batch_prediction_version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ def __init__(self, client, batchPredictionVersion=None, batchPredictionId=None,
100100
BatchPredictionArgs, globalPredictionArgs)
101101
self.batch_prediction_args = client._build_class(getattr(
102102
api_class, batchPredictionArgsType, BatchPredictionArgs) if batchPredictionArgsType else BatchPredictionArgs, batchPredictionArgs)
103-
self.deprecated_keys = {'global_prediction_args', 'explanations'}
103+
self.deprecated_keys = {'explanations', 'global_prediction_args'}
104104

105105
def __repr__(self):
106106
repr_dict = {f'batch_prediction_version': repr(self.batch_prediction_version), f'batch_prediction_id': repr(self.batch_prediction_id), f'status': repr(self.status), f'drift_monitor_status': repr(self.drift_monitor_status), f'deployment_id': repr(self.deployment_id), f'model_id': repr(self.model_id), f'model_version': repr(self.model_version), f'predictions_started_at': repr(self.predictions_started_at), f'predictions_completed_at': repr(self.predictions_completed_at), f'database_output_error': repr(self.database_output_error), f'total_predictions': repr(self.total_predictions), f'failed_predictions': repr(self.failed_predictions), f'database_connector_id': repr(self.database_connector_id), f'database_output_configuration': repr(self.database_output_configuration), f'file_connector_output_location': repr(self.file_connector_output_location), f'file_output_format': repr(self.file_output_format), f'connector_type': repr(self.connector_type), f'legacy_input_location': repr(self.legacy_input_location), f'error': repr(self.error), f'drift_monitor_error': repr(self.drift_monitor_error), f'monitor_warnings': repr(self.monitor_warnings), f'csv_input_prefix': repr(

0 commit comments

Comments
 (0)