Skip to content

Commit 9a999e0

Browse files
author
Brandon Lefore
committed
Version 0.79.2
1 parent c869676 commit 9a999e0

File tree

241 files changed

+4491
-1029
lines changed

Some content is hidden

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

241 files changed

+4491
-1029
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.79.0"
7+
__version__ = "0.79.2"

abacusai/api_class/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
from .ai_agents import *
12
from .batch_prediction import *
23
from .blob_input import *
34
from .dataset import *

abacusai/api_class/ai_agents.py

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
import dataclasses
2+
from typing import Union
3+
4+
from . import enums
5+
from .abstract import ApiClass
6+
7+
8+
@dataclasses.dataclass
9+
class FieldDescriptor(ApiClass):
10+
"""
11+
Configs for vector store indexing.
12+
13+
Args:
14+
field (str): The field to be extracted. This will be used as the key in the response.
15+
description (str): The description of this field. If not included, the response_field will be used.
16+
example_extraction (Union[str, int, bool, float]): An example of this extracted field.
17+
type (enums.FieldDescriptorType): The type of this field. If not provided, the default type is STRING.
18+
"""
19+
field: str = dataclasses.field()
20+
description: str = dataclasses.field(default=None)
21+
example_extraction: Union[str, int, bool, float, list, dict] = dataclasses.field(default=None)
22+
type: enums.FieldDescriptorType = dataclasses.field(default=enums.FieldDescriptorType.STRING)

abacusai/api_class/dataset.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,4 @@ class DocumentProcessingConfig(ApiClass):
1919
remove_watermarks: bool = None
2020
use_full_ocr: bool = None
2121
layout_analysis: bool = False
22+
enhanced_layout_detection: bool = False

abacusai/api_class/dataset_application_connector.py

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,27 @@ def __post_init__(self):
3939
self.application_connector_type = enums.ApplicationConnectorType.GOOGLEANALYTICS
4040

4141

42+
@dataclasses.dataclass
43+
class GoogleDriveDatasetConfig(DatasetConfig):
44+
"""
45+
Dataset config for Google Drive 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. Not applicable if is_documentset is True
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.GOOGLEDRIVE
61+
62+
4263
@dataclasses.dataclass
4364
class SharepointDatasetConfig(DatasetConfig):
4465
"""
@@ -48,7 +69,7 @@ class SharepointDatasetConfig(DatasetConfig):
4869
is_documentset (bool): Whether the dataset is a document set
4970
csv_delimiter (str, optional): If the file format is CSV, use a specific csv delimiter
5071
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
72+
merge_file_schemas (bool, optional): Signifies if the merge file schema policy is enabled. Not applicable if is_documentset is True
5273
"""
5374
location: str = dataclasses.field(default=None)
5475
is_documentset: bool = dataclasses.field(default=None)
@@ -76,6 +97,7 @@ class _DatasetConfigFactory(_ApiClassFactory):
7697
config_class_map = {
7798
enums.ApplicationConnectorType.CONFLUENCE: ConfluenceDatasetConfig,
7899
enums.ApplicationConnectorType.GOOGLEANALYTICS: GoogleAnalyticsDatasetConfig,
100+
enums.ApplicationConnectorType.GOOGLEDRIVE: GoogleDriveDatasetConfig,
79101
enums.ApplicationConnectorType.SHAREPOINT: SharepointDatasetConfig,
80102
enums.ApplicationConnectorType.ZENDESK: ZendeskDatasetConfig,
81103
}

abacusai/api_class/enums.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -323,6 +323,7 @@ class ConnectorType(ApiEnum):
323323

324324
class ApplicationConnectorType(ApiEnum):
325325
GOOGLEANALYTICS = 'GOOGLEANALYTICS'
326+
GOOGLEDRIVE = 'GOOGLEDRIVE'
326327
GIT = 'GIT'
327328
CONFLUENCE = 'CONFLUENCE'
328329
ZENDESK = 'ZENDESK'
@@ -422,3 +423,18 @@ class PythonFunctionType(ApiEnum):
422423
FEATURE_GROUP = 'FEATURE_GROUP'
423424
PLOTLY_FIG = 'PLOTLY_FIG'
424425
STEP_FUNCTION = 'STEP_FUNCTION'
426+
427+
428+
class EvalArtifactType(ApiEnum):
429+
FORECASTING_ACCURACY = 'bar_chart'
430+
FORECASTING_VOLUME = 'bar_chart_volume'
431+
FORECASTING_HISTORY_LENGTH_ACCURACY = 'bar_chart_accuracy_by_history'
432+
433+
434+
class FieldDescriptorType(ApiEnum):
435+
STRING = 'STRING'
436+
INTEGER = 'INTEGER'
437+
FLOAT = 'FLOAT'
438+
BOOLEAN = 'BOOLEAN'
439+
DATETIME = 'DATETIME'
440+
DATE = 'DATE'

abacusai/api_class/model.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -57,11 +57,7 @@ class PersonalizationTrainingConfig(TrainingConfig):
5757
compute_session_metrics (bool): Evaluate models based on how well they are able to predict the next session of interactions.
5858
max_user_history_len_percentile (int): Filter out users with history length above this percentile.
5959
downsample_item_popularity_percentile (float): Downsample items more popular than this percentile.
60-
<<<<<<< HEAD
61-
allow_duplicate_action_types (List[str]): event types which will not be deduplicated.
6260
use_user_id_feature (bool): Use user id as a feature in CTR models.
63-
=======
64-
>>>>>>> e5f12c159c (add config options for session dedupe and recommendation exclusion)
6561
"""
6662
# top-level params
6763
objective: enums.PersonalizationObjective = dataclasses.field(default=None)
@@ -382,6 +378,8 @@ class NamedEntityExtractionTrainingConfig(TrainingConfig):
382378
active_labels_column (str): Entities that have been marked in a particular text
383379
document_format (NLPDocumentFormat): Format of the input documents.
384380
include_longformer (bool): Whether to include the longformer model.
381+
save_predicted_pdf (bool): Whether to save predicted PDF documents
382+
enhanced_ocr (bool): Enhanced text extraction from predicted digital documents
385383
"""
386384
objective: enums.NERObjective = dataclasses.field(default=None)
387385
sort_objective: enums.NERObjective = dataclasses.field(default=None)
@@ -396,6 +394,9 @@ class NamedEntityExtractionTrainingConfig(TrainingConfig):
396394
active_labels_column: str = dataclasses.field(default=None)
397395
document_format: enums.NLPDocumentFormat = dataclasses.field(default=None)
398396
include_longformer: bool = dataclasses.field(default=None)
397+
# OCR
398+
save_predicted_pdf: bool = True
399+
enhanced_ocr: bool = False
399400

400401
def __post_init__(self):
401402
self.problem_type = enums.ProblemType.NAMED_ENTITY_EXTRACTION

abacusai/api_endpoint.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,17 +10,19 @@ class ApiEndpoint(AbstractApiClass):
1010
apiEndpoint (str): The URI that can be used to make API calls
1111
predictEndpoint (str): The URI that can be used to make predict calls against Deployments
1212
proxyEndpoint (str): The URI that can be used to make proxy server calls
13+
llmEndpoint (str): The URI that can be used to make llm api calls
1314
"""
1415

15-
def __init__(self, client, apiEndpoint=None, predictEndpoint=None, proxyEndpoint=None):
16+
def __init__(self, client, apiEndpoint=None, predictEndpoint=None, proxyEndpoint=None, llmEndpoint=None):
1617
super().__init__(client, None)
1718
self.api_endpoint = apiEndpoint
1819
self.predict_endpoint = predictEndpoint
1920
self.proxy_endpoint = proxyEndpoint
21+
self.llm_endpoint = llmEndpoint
2022

2123
def __repr__(self):
2224
repr_dict = {f'api_endpoint': repr(self.api_endpoint), f'predict_endpoint': repr(
23-
self.predict_endpoint), f'proxy_endpoint': repr(self.proxy_endpoint)}
25+
self.predict_endpoint), f'proxy_endpoint': repr(self.proxy_endpoint), f'llm_endpoint': repr(self.llm_endpoint)}
2426
class_name = "ApiEndpoint"
2527
repr_str = ',\n '.join([f'{key}={value}' for key, value in repr_dict.items(
2628
) if getattr(self, key, None) is not None])
@@ -33,6 +35,6 @@ def to_dict(self):
3335
Returns:
3436
dict: The dict value representation of the class parameters
3537
"""
36-
resp = {'api_endpoint': self.api_endpoint, 'predict_endpoint':
37-
self.predict_endpoint, 'proxy_endpoint': self.proxy_endpoint}
38+
resp = {'api_endpoint': self.api_endpoint, 'predict_endpoint': self.predict_endpoint,
39+
'proxy_endpoint': self.proxy_endpoint, 'llm_endpoint': self.llm_endpoint}
3840
return {key: value for key, value in resp.items() if value is not None}

abacusai/chat_session.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,12 @@ class ChatSession(AbstractApiClass):
1616
createdAt (str): The timestamp at which the chat session was created
1717
status (str): The status of the chat sessions
1818
aiBuildingInProgress (bool): Whether the AI building is in progress or not
19+
notification (str): A warn/info message about the chat session. For example, a suggestion to create a new session if the current one is too old
1920
chatHistory (ChatMessage): The chat history for the conversation
2021
nextAiBuildingTask (AiBuildingTask): The next AI building task for the chat session
2122
"""
2223

23-
def __init__(self, client, answer=None, chatSessionId=None, projectId=None, name=None, createdAt=None, status=None, aiBuildingInProgress=None, chatHistory={}, nextAiBuildingTask={}):
24+
def __init__(self, client, answer=None, chatSessionId=None, projectId=None, name=None, createdAt=None, status=None, aiBuildingInProgress=None, notification=None, chatHistory={}, nextAiBuildingTask={}):
2425
super().__init__(client, chatSessionId)
2526
self.answer = answer
2627
self.chat_session_id = chatSessionId
@@ -29,13 +30,14 @@ def __init__(self, client, answer=None, chatSessionId=None, projectId=None, name
2930
self.created_at = createdAt
3031
self.status = status
3132
self.ai_building_in_progress = aiBuildingInProgress
33+
self.notification = notification
3234
self.chat_history = client._build_class(ChatMessage, chatHistory)
3335
self.next_ai_building_task = client._build_class(
3436
AiBuildingTask, nextAiBuildingTask)
3537

3638
def __repr__(self):
3739
repr_dict = {f'answer': repr(self.answer), f'chat_session_id': repr(self.chat_session_id), f'project_id': repr(self.project_id), f'name': repr(self.name), f'created_at': repr(self.created_at), f'status': repr(
38-
self.status), f'ai_building_in_progress': repr(self.ai_building_in_progress), f'chat_history': repr(self.chat_history), f'next_ai_building_task': repr(self.next_ai_building_task)}
40+
self.status), f'ai_building_in_progress': repr(self.ai_building_in_progress), f'notification': repr(self.notification), f'chat_history': repr(self.chat_history), f'next_ai_building_task': repr(self.next_ai_building_task)}
3941
class_name = "ChatSession"
4042
repr_str = ',\n '.join([f'{key}={value}' for key, value in repr_dict.items(
4143
) if getattr(self, key, None) is not None])
@@ -48,8 +50,8 @@ def to_dict(self):
4850
Returns:
4951
dict: The dict value representation of the class parameters
5052
"""
51-
resp = {'answer': self.answer, 'chat_session_id': self.chat_session_id, 'project_id': self.project_id, 'name': self.name, 'created_at': self.created_at, 'status': self.status,
52-
'ai_building_in_progress': self.ai_building_in_progress, 'chat_history': self._get_attribute_as_dict(self.chat_history), 'next_ai_building_task': self._get_attribute_as_dict(self.next_ai_building_task)}
53+
resp = {'answer': self.answer, 'chat_session_id': self.chat_session_id, 'project_id': self.project_id, 'name': self.name, 'created_at': self.created_at, 'status': self.status, 'ai_building_in_progress':
54+
self.ai_building_in_progress, 'notification': self.notification, 'chat_history': self._get_attribute_as_dict(self.chat_history), 'next_ai_building_task': self._get_attribute_as_dict(self.next_ai_building_task)}
5355
return {key: value for key, value in resp.items() if value is not None}
5456

5557
def get(self):

0 commit comments

Comments
 (0)