Skip to content

Commit 804db7e

Browse files
author
Brandon Lefore
committed
Version 0.78.5
1 parent e70cfb3 commit 804db7e

File tree

263 files changed

+7715
-936
lines changed

Some content is hidden

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

263 files changed

+7715
-936
lines changed

abacusai/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@
44
from .streaming_client import StreamingClient
55

66

7-
__version__ = "0.78.0"
7+
__version__ = "0.78.5"

abacusai/agent.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,12 @@ class Agent(AbstractApiClass):
1818
sourceCode (str): Python code used to make the agent.
1919
agentConfig (dict): The config options used to create this agent.
2020
memory (int): Memory in GB specified for the deployment resources for the agent.
21+
trainingRequired (bool): Whether training is required to deploy the latest agent code.
2122
latestAgentVersion (AgentVersion): The latest agent version.
2223
codeSource (CodeSource): If a python model, information on the source code
2324
"""
2425

25-
def __init__(self, client, name=None, agentId=None, createdAt=None, projectId=None, notebookId=None, predictFunctionName=None, sourceCode=None, agentConfig=None, memory=None, codeSource={}, latestAgentVersion={}):
26+
def __init__(self, client, name=None, agentId=None, createdAt=None, projectId=None, notebookId=None, predictFunctionName=None, sourceCode=None, agentConfig=None, memory=None, trainingRequired=None, codeSource={}, latestAgentVersion={}):
2627
super().__init__(client, agentId)
2728
self.name = name
2829
self.agent_id = agentId
@@ -33,13 +34,14 @@ def __init__(self, client, name=None, agentId=None, createdAt=None, projectId=No
3334
self.source_code = sourceCode
3435
self.agent_config = agentConfig
3536
self.memory = memory
37+
self.training_required = trainingRequired
3638
self.code_source = client._build_class(CodeSource, codeSource)
3739
self.latest_agent_version = client._build_class(
3840
AgentVersion, latestAgentVersion)
3941

4042
def __repr__(self):
41-
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(
42-
self.predict_function_name), f'source_code': repr(self.source_code), f'agent_config': repr(self.agent_config), f'memory': repr(self.memory), f'code_source': repr(self.code_source), f'latest_agent_version': repr(self.latest_agent_version)}
43+
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(
44+
self.source_code), f'agent_config': repr(self.agent_config), f'memory': repr(self.memory), f'training_required': repr(self.training_required), f'code_source': repr(self.code_source), f'latest_agent_version': repr(self.latest_agent_version)}
4345
class_name = "Agent"
4446
repr_str = ',\n '.join([f'{key}={value}' for key, value in repr_dict.items(
4547
) if getattr(self, key, None) is not None])
@@ -52,8 +54,8 @@ def to_dict(self):
5254
Returns:
5355
dict: The dict value representation of the class parameters
5456
"""
55-
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,
56-
'source_code': self.source_code, 'agent_config': self.agent_config, 'memory': self.memory, 'code_source': self._get_attribute_as_dict(self.code_source), 'latest_agent_version': self._get_attribute_as_dict(self.latest_agent_version)}
57+
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,
58+
'agent_config': self.agent_config, 'memory': self.memory, 'training_required': self.training_required, 'code_source': self._get_attribute_as_dict(self.code_source), 'latest_agent_version': self._get_attribute_as_dict(self.latest_agent_version)}
5759
return {key: value for key, value in resp.items() if value is not None}
5860

5961
def refresh(self):

abacusai/ai_building_task.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
class AiBuildingTask(AbstractApiClass):
55
"""
6-
A task for AI Chat to help build AI.
6+
A task for Data Science Co-pilot to help build AI.
77
88
Args:
99
client (ApiClient): An authenticated API Client instance

abacusai/api_class/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
from .batch_prediction import *
22
from .blob_input import *
33
from .dataset import *
4+
from .dataset_application_connector import *
45
from .document_retriever import *
56
from .enums import *
67
from .feature_group import *

abacusai/api_class/abstract.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,10 @@ def from_dict(cls, config: dict) -> ApiClass:
154154
support_kwargs = cls.config_abstract_class and cls.config_abstract_class._support_kwargs
155155
config_class_key = cls.config_class_key if (cls.config_abstract_class and not cls.config_abstract_class._upper_snake_case_keys) else camel_case(cls.config_class_key)
156156
if not support_kwargs and config_class_key not in (config or {}):
157-
raise KeyError(f'Could not find {config_class_key} in {config}')
157+
if camel_case(config_class_key) in (config or {}):
158+
config_class_key = camel_case(config_class_key)
159+
else:
160+
raise KeyError(f'Could not find {config_class_key} in {config}')
158161
config_class_type = config.get(config_class_key, None)
159162
if isinstance(config_class_type, str):
160163
config_class_type = config_class_type.upper()

abacusai/api_class/batch_prediction.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -203,10 +203,8 @@ class ChatLLMBatchPredictionArgs(BatchPredictionArgs):
203203
Batch Prediction Config for the ChatLLM problem type
204204
Args:
205205
for_eval (bool): If True, the test fold which was created during training and used for metrics calculation will be used as input data. These predictions are hence, used for model evaluation.
206-
product (bool): Generate a response for every question and chunk combination
207206
"""
208207
for_eval: bool = dataclasses.field(default=None)
209-
product: bool = None
210208

211209
def __post_init__(self):
212210
self.problem_type = enums.ProblemType.CHAT_LLM
Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
import dataclasses
2+
3+
from . import enums
4+
from .abstract import ApiClass, _ApiClassFactory
5+
6+
7+
@dataclasses.dataclass
8+
class DatasetConfig(ApiClass):
9+
application_connector_type: enums.ApplicationConnectorType = dataclasses.field(default=None, repr=False)
10+
11+
@classmethod
12+
def _get_builder(cls):
13+
return _DatasetConfigFactory
14+
15+
16+
@dataclasses.dataclass
17+
class ConfluenceDatasetConfig(DatasetConfig):
18+
"""
19+
Dataset config for Confluence Application Connector
20+
"""
21+
def __post_init__(self):
22+
self.application_connector_type = enums.ApplicationConnectorType.CONFLUENCE
23+
24+
25+
@dataclasses.dataclass
26+
class GoogleAnalyticsDatasetConfig(DatasetConfig):
27+
"""
28+
Dataset config for Google Analytics Application Connector
29+
Args:
30+
location (str): The view id of the report in the connector to fetch
31+
start_timestamp (int, optional): Unix timestamp of the start of the period that will be queried
32+
end_timestamp (int, optional): Unix timestamp of the end of the period that will be queried
33+
"""
34+
location: str = dataclasses.field(default=None)
35+
start_timestamp: int = dataclasses.field(default=None)
36+
end_timestamp: int = dataclasses.field(default=None)
37+
38+
def __post_init__(self):
39+
self.application_connector_type = enums.ApplicationConnectorType.GOOGLEANALYTICS
40+
41+
42+
@dataclasses.dataclass
43+
class SharepointDatasetConfig(DatasetConfig):
44+
"""
45+
Dataset config for Sharepoint Application Connector
46+
Args:
47+
location (str): The regex location of the files to fetch
48+
is_documentset (bool): Whether the dataset is a document set
49+
csv_delimiter (str, optional): If the file format is CSV, use a specific csv delimiter
50+
extract_bounding_boxes (bool, optional): Signifies whether to extract bounding boxes out of the documents. Only valid if is_documentset if True
51+
merge_file_schemas (bool, optional): Signifies if the merge file schema policy is enabled. If is_documentset is True, this is also set to True by default
52+
"""
53+
location: str = dataclasses.field(default=None)
54+
is_documentset: bool = dataclasses.field(default=None)
55+
csv_delimiter: str = dataclasses.field(default=None)
56+
extract_bounding_boxes: bool = dataclasses.field(default=False)
57+
merge_file_schemas: bool = dataclasses.field(default=False)
58+
59+
def __post_init__(self):
60+
self.application_connector_type = enums.ApplicationConnectorType.SHAREPOINT
61+
62+
63+
@dataclasses.dataclass
64+
class ZendeskDatasetConfig(DatasetConfig):
65+
"""
66+
Dataset config for Zendesk Application Connector
67+
"""
68+
def __post_init__(self):
69+
self.application_connector_type = enums.ApplicationConnectorType.ZENDESK
70+
71+
72+
@dataclasses.dataclass
73+
class _DatasetConfigFactory(_ApiClassFactory):
74+
config_abstract_class = DatasetConfig
75+
config_class_key = 'applicationConnectorType'
76+
config_class_map = {
77+
enums.ApplicationConnectorType.CONFLUENCE: ConfluenceDatasetConfig,
78+
enums.ApplicationConnectorType.GOOGLEANALYTICS: GoogleAnalyticsDatasetConfig,
79+
enums.ApplicationConnectorType.SHAREPOINT: SharepointDatasetConfig,
80+
enums.ApplicationConnectorType.ZENDESK: ZendeskDatasetConfig,
81+
}

abacusai/api_class/enums.py

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,30 @@ class HolidayCalendars(ApiEnum):
155155
US = 'US'
156156

157157

158+
class FileFormat(ApiEnum):
159+
AVRO = 'AVRO'
160+
PARQUET = 'PARQUET'
161+
TFRECORD = 'TFRECORD'
162+
TSV = 'TSV'
163+
CSV = 'CSV'
164+
ORC = 'ORC'
165+
JSON = 'JSON'
166+
ODS = 'ODS'
167+
XLS = 'XLS'
168+
GZ = 'GZ'
169+
ZIP = 'ZIP'
170+
TAR = 'TAR'
171+
DOCX = 'DOCX'
172+
PDF = 'PDF'
173+
RAR = 'RAR'
174+
JPEG = 'JPG'
175+
PNG = 'PNG'
176+
TIF = 'TIFF'
177+
NUMBERS = 'NUMBERS'
178+
PPTX = 'PPTX'
179+
PPT = 'PPT'
180+
181+
158182
class ExperimentationMode(ApiEnum):
159183
RAPID = 'rapid'
160184
THOROUGH = 'thorough'
@@ -296,6 +320,16 @@ class ConnectorType(ApiEnum):
296320
APPLICATION = 'APPLICATION'
297321

298322

323+
class ApplicationConnectorType(ApiEnum):
324+
GOOGLEANALYTICS = 'GOOGLEANALYTICS'
325+
GIT = 'GIT'
326+
CONFLUENCE = 'CONFLUENCE'
327+
ZENDESK = 'ZENDESK'
328+
SLACK = 'SLACK'
329+
SHAREPOINT = 'SHAREPOINT'
330+
TEAMS = 'TEAMS'
331+
332+
299333
class PythonFunctionArgumentType(ApiEnum):
300334
FEATURE_GROUP = 'FEATURE_GROUP'
301335
INTEGER = 'INTEGER'

abacusai/api_class/model.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -741,3 +741,19 @@ class _TrainingConfigFactory(_ApiClassFactory):
741741
enums.ProblemType.CUSTOM_ALGORITHM: CustomAlgorithmTrainingConfig,
742742
enums.ProblemType.OPTIMIZATION: OptimizationTrainingConfig
743743
}
744+
745+
746+
@dataclasses.dataclass
747+
class DeployableAlgorithm(ApiClass):
748+
"""
749+
Algorithm that can be deployed to a model.
750+
Args:
751+
algorithm (str): ID of the algorithm.
752+
name (str): Name of the algorithm.
753+
only_offline_deployable (bool): Whether the algorithm can only be deployed offline.
754+
trained_model_types (List[dict]): List of trained model types.
755+
"""
756+
algorithm: str = dataclasses.field(default=None)
757+
name: str = dataclasses.field(default=None)
758+
only_offline_deployable: bool = dataclasses.field(default=None)
759+
trained_model_types: List[dict] = dataclasses.field(default=None)

abacusai/api_class/monitor_alert.py

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,46 +23,58 @@ class AccuracyBelowThresholdConditionConfig(AlertConditionConfig):
2323
"""
2424
threshold: float = dataclasses.field(default=None)
2525

26+
def __post_init__(self):
27+
self.alert_type = enums.MonitorAlertType.ACCURACY_BELOW_THRESHOLD
28+
2629

2730
@dataclasses.dataclass
2831
class FeatureDriftConditionConfig(AlertConditionConfig):
2932
"""
3033
Feature Drift Condition Config for Monitor Alerts
3134
Args:
32-
feature_drift_type (str): Feature drift type to apply the threshold on to determine whether a column has drifted significantly enough to be a violation.
35+
feature_drift_type (FeatureDriftType): Feature drift type to apply the threshold on to determine whether a column has drifted significantly enough to be a violation.
3336
threshold (float): Threshold for when to consider a column to be in violation. The alert will only fire when the drift value is strictly greater than the threshold.
3437
minimum_violations (int): Number of columns that must exceed the specified threshold to trigger an alert.
3538
"""
3639
feature_drift_type: enums.FeatureDriftType = dataclasses.field(default=None)
3740
threshold: float = dataclasses.field(default=None)
3841
minimum_violations: int = dataclasses.field(default=None)
3942

43+
def __post_init__(self):
44+
self.alert_type = enums.MonitorAlertType.FEATURE_DRIFT
45+
4046

4147
@dataclasses.dataclass
4248
class DataIntegrityViolationConditionConfig(AlertConditionConfig):
4349
"""
4450
Data Integrity Violation Condition Config for Monitor Alerts
4551
Args:
46-
data_integrity_type (enums.DataIntegrityViolationType): This option selects the data integrity violations to monitor for this alert.
52+
data_integrity_type (DataIntegrityViolationType): This option selects the data integrity violations to monitor for this alert.
4753
minimum_violations (int): Number of columns that must exceed the specified threshold to trigger an alert.
4854
"""
4955
data_integrity_type: enums.DataIntegrityViolationType = dataclasses.field(default=None)
5056
minimum_violations: int = dataclasses.field(default=None)
5157

58+
def __post_init__(self):
59+
self.alert_type = enums.MonitorAlertType.DATA_INTEGRITY_VIOLATIONS
60+
5261

5362
@dataclasses.dataclass
5463
class BiasViolationConditionConfig(AlertConditionConfig):
5564
"""
5665
Bias Violation Condition Config for Monitor Alerts
5766
Args:
58-
bias_type (enums.BiasType): This option selects the bias metric to monitor for this alert.
67+
bias_type (BiasType): This option selects the bias metric to monitor for this alert.
5968
threshold (float): Threshold for when to consider a column to be in violation. The alert will only fire when the drift value is strictly greater than the threshold.
6069
minimum_violations (int): Number of columns that must exceed the specified threshold to trigger an alert.
6170
"""
6271
bias_type: enums.BiasType = dataclasses.field(default=None)
6372
threshold: float = dataclasses.field(default=None)
6473
minimum_violations: int = dataclasses.field(default=None)
6574

75+
def __post_init__(self):
76+
self.alert_type = enums.MonitorAlertType.BIAS_VIOLATIONS
77+
6678

6779
@dataclasses.dataclass
6880
class _AlertConditionConfigFactory(_ApiClassFactory):

0 commit comments

Comments
 (0)