Skip to content

Commit 226c74a

Browse files
committed
Version 1.4.28
1 parent 75f264e commit 226c74a

File tree

280 files changed

+1467
-281
lines changed

Some content is hidden

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

280 files changed

+1467
-281
lines changed

abacusai/__init__.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
from .app_user_group import AppUserGroup
2020
from .app_user_group_sign_in_token import AppUserGroupSignInToken
2121
from .application_connector import ApplicationConnector
22+
from .audio_gen_settings import AudioGenSettings
2223
from .batch_prediction import BatchPrediction
2324
from .batch_prediction_version import BatchPredictionVersion
2425
from .batch_prediction_version_logs import BatchPredictionVersionLogs
@@ -231,4 +232,4 @@
231232
from .workflow_node_template import WorkflowNodeTemplate
232233

233234

234-
__version__ = "1.4.27"
235+
__version__ = "1.4.28"

abacusai/address.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,10 @@ class Address(AbstractApiClass):
1414
postalCode (str): The postal code
1515
country (str): The country
1616
additionalInfo (str): Additional information for invoice
17+
includeReverseCharge (bool): Whether the organization needs the reverse charge mechanism applied to invoices.
1718
"""
1819

19-
def __init__(self, client, addressLine1=None, addressLine2=None, city=None, stateOrProvince=None, postalCode=None, country=None, additionalInfo=None):
20+
def __init__(self, client, addressLine1=None, addressLine2=None, city=None, stateOrProvince=None, postalCode=None, country=None, additionalInfo=None, includeReverseCharge=None):
2021
super().__init__(client, None)
2122
self.address_line_1 = addressLine1
2223
self.address_line_2 = addressLine2
@@ -25,11 +26,12 @@ def __init__(self, client, addressLine1=None, addressLine2=None, city=None, stat
2526
self.postal_code = postalCode
2627
self.country = country
2728
self.additional_info = additionalInfo
29+
self.include_reverse_charge = includeReverseCharge
2830
self.deprecated_keys = {}
2931

3032
def __repr__(self):
31-
repr_dict = {f'address_line_1': repr(self.address_line_1), f'address_line_2': repr(self.address_line_2), f'city': repr(self.city), f'state_or_province': repr(
32-
self.state_or_province), f'postal_code': repr(self.postal_code), f'country': repr(self.country), f'additional_info': repr(self.additional_info)}
33+
repr_dict = {f'address_line_1': repr(self.address_line_1), f'address_line_2': repr(self.address_line_2), f'city': repr(self.city), f'state_or_province': repr(self.state_or_province), f'postal_code': repr(
34+
self.postal_code), f'country': repr(self.country), f'additional_info': repr(self.additional_info), f'include_reverse_charge': repr(self.include_reverse_charge)}
3335
class_name = "Address"
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,6 +44,6 @@ def to_dict(self):
4244
Returns:
4345
dict: The dict value representation of the class parameters
4446
"""
45-
resp = {'address_line_1': self.address_line_1, 'address_line_2': self.address_line_2, 'city': self.city, 'state_or_province':
46-
self.state_or_province, 'postal_code': self.postal_code, 'country': self.country, 'additional_info': self.additional_info}
47+
resp = {'address_line_1': self.address_line_1, 'address_line_2': self.address_line_2, 'city': self.city, 'state_or_province': self.state_or_province,
48+
'postal_code': self.postal_code, 'country': self.country, 'additional_info': self.additional_info, 'include_reverse_charge': self.include_reverse_charge}
4749
return {key: value for key, value in resp.items() if value is not None and key not in self.deprecated_keys}

abacusai/api_class/ai_agents.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -496,6 +496,12 @@ def to_dict(self):
496496
'trigger_config': self.trigger_config.to_dict() if self.trigger_config else None
497497
}
498498

499+
def is_template_node(self):
500+
return self.template_metadata is not None
501+
502+
def is_trigger_node(self):
503+
return self.trigger_config is not None
504+
499505
@classmethod
500506
def from_dict(cls, node: dict):
501507
validate_input_dict_param(node, friendly_class_name='workflow_graph_node', must_contain=['name', 'function_name', 'source_code'])

abacusai/api_class/enums.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -462,7 +462,7 @@ class VectorStoreTextEncoder(ApiEnum):
462462
CODE_BERT = 'CODE_BERT'
463463

464464

465-
@deprecated_enums('OPENAI_GPT4_32K', 'OPENAI_GPT3_5', 'OPENAI_GPT3_5_TEXT', 'LLAMA3_LARGE_CHAT', 'CLAUDE_V3_OPUS', 'CLAUDE_V3_SONNET', 'OPENAI_GPT4', 'OPENAI_GPT4_128K')
465+
@deprecated_enums('OPENAI_GPT4_32K', 'OPENAI_GPT3_5', 'OPENAI_GPT3_5_TEXT', 'LLAMA3_LARGE_CHAT', 'CLAUDE_V3_OPUS', 'CLAUDE_V3_SONNET', 'OPENAI_GPT4', 'OPENAI_GPT4_128K', 'QWEN_2_5_32B_BASE')
466466
class LLMName(ApiEnum):
467467
OPENAI_GPT4 = 'OPENAI_GPT4'
468468
OPENAI_GPT4_32K = 'OPENAI_GPT4_32K'
@@ -494,6 +494,7 @@ class LLMName(ApiEnum):
494494
GEMINI_1_5_FLASH = 'GEMINI_1_5_FLASH'
495495
XAI_GROK = 'XAI_GROK'
496496
DEEPSEEK_V3 = 'DEEPSEEK_V3'
497+
DEEPSEEK_R1 = 'DEEPSEEK_R1'
497498

498499

499500
class MonitorAlertType(ApiEnum):

abacusai/api_client_utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ def process_streaming_data(cls, value, context, section_key, data_type, is_trans
106106
context.streamed_section_response.append(
107107
{'id': section_key, 'type': data_type, 'mime_type': 'text/plain', 'contents': value})
108108
else:
109-
context.streamed_response.append(value)
109+
context.streamed_response.append(str(value))
110110
elif data_type == 'segment':
111111
context.streamed_section_response.append(value)
112112

abacusai/audio_gen_settings.py

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
from .return_class import AbstractApiClass
2+
3+
4+
class AudioGenSettings(AbstractApiClass):
5+
"""
6+
Audio generation settings
7+
8+
Args:
9+
client (ApiClient): An authenticated API Client instance
10+
model (dict): Dropdown for models available for audio generation.
11+
"""
12+
13+
def __init__(self, client, model=None):
14+
super().__init__(client, None)
15+
self.model = model
16+
self.deprecated_keys = {}
17+
18+
def __repr__(self):
19+
repr_dict = {f'model': repr(self.model)}
20+
class_name = "AudioGenSettings"
21+
repr_str = ',\n '.join([f'{key}={value}' for key, value in repr_dict.items(
22+
) if getattr(self, key, None) is not None and key not in self.deprecated_keys])
23+
return f"{class_name}({repr_str})"
24+
25+
def to_dict(self):
26+
"""
27+
Get a dict representation of the parameters in this class
28+
29+
Returns:
30+
dict: The dict value representation of the class parameters
31+
"""
32+
resp = {'model': self.model}
33+
return {key: value for key, value in resp.items() if value is not None and key not in self.deprecated_keys}

abacusai/client.py

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -287,6 +287,15 @@ def __init__(self, *args, **kwargs):
287287
for key, value in kwargs.items():
288288
self.section_data_list.append({key: value})
289289

290+
def __getstate__(self):
291+
"""Return state values to be pickled."""
292+
return {'data_list': self.data_list, 'section_data_list': self.section_data_list}
293+
294+
def __setstate__(self, state):
295+
"""Restore state from the unpickled state values."""
296+
self.data_list = state['data_list']
297+
self.section_data_list = state['section_data_list']
298+
290299
def to_dict(self):
291300
"""
292301
Get a dict representation of the response object
@@ -643,7 +652,7 @@ class BaseApiClient:
643652
client_options (ClientOptions): Optional API client configurations
644653
skip_version_check (bool): If true, will skip checking the server's current API version on initializing the client
645654
"""
646-
client_version = '1.4.27'
655+
client_version = '1.4.28'
647656

648657
def __init__(self, api_key: str = None, server: str = None, client_options: ClientOptions = None, skip_version_check: bool = False, include_tb: bool = False):
649658
self.api_key = api_key
@@ -4668,7 +4677,7 @@ def rename_project(self, project_id: str, name: str):
46684677
name (str): The new name for the project."""
46694678
return self._call_api('renameProject', 'PATCH', query_params={}, body={'projectId': project_id, 'name': name})
46704679

4671-
def delete_project(self, project_id: str):
4680+
def delete_project(self, project_id: str, force_delete: bool = False):
46724681
"""Delete a specified project from your organization.
46734682

46744683
This method deletes the project, its associated trained models, and deployments. The datasets attached to the specified project remain available for use with other projects in the organization.
@@ -4679,8 +4688,9 @@ def delete_project(self, project_id: str):
46794688

46804689

46814690
Args:
4682-
project_id (str): The unique ID of the project to delete."""
4683-
return self._call_api('deleteProject', 'DELETE', query_params={'projectId': project_id})
4691+
project_id (str): The unique ID of the project to delete.
4692+
force_delete (bool): If True, the project will be deleted even if it has active deployments."""
4693+
return self._call_api('deleteProject', 'DELETE', query_params={'projectId': project_id, 'forceDelete': force_delete})
46844694

46854695
def add_project_tags(self, project_id: str, tags: list):
46864696
"""This method adds a tag to a project.
@@ -8859,7 +8869,7 @@ def restart_document_retriever(self, document_retriever_id: str):
88598869
document_retriever_id (str): A unique string identifier associated with the document retriever."""
88608870
return self._call_api('restartDocumentRetriever', 'POST', query_params={}, body={'documentRetrieverId': document_retriever_id})
88618871

8862-
def get_relevant_snippets(self, doc_ids: List = None, blobs: io.TextIOBase = None, query: str = None, document_retriever_config: Union[dict, VectorStoreConfig] = None, honor_sentence_boundary: bool = True, num_retrieval_margin_words: int = None, max_words_per_snippet: int = None, max_snippets_per_document: int = None, start_word_index: int = None, end_word_index: int = None, including_bounding_boxes: bool = False, text: str = None) -> List[DocumentRetrieverLookupResult]:
8872+
def get_relevant_snippets(self, doc_ids: List = None, blobs: io.TextIOBase = None, query: str = None, document_retriever_config: Union[dict, VectorStoreConfig] = None, honor_sentence_boundary: bool = True, num_retrieval_margin_words: int = None, max_words_per_snippet: int = None, max_snippets_per_document: int = None, start_word_index: int = None, end_word_index: int = None, including_bounding_boxes: bool = False, text: str = None, document_processing_config: Union[dict, DocumentProcessingConfig] = None) -> List[DocumentRetrieverLookupResult]:
88638873
"""Retrieves snippets relevant to a given query from specified documents. This function supports flexible input options,
88648874

88658875
allowing for retrieval from a variety of data sources including document IDs, blob data, and plain text. When multiple data
@@ -8878,7 +8888,8 @@ def get_relevant_snippets(self, doc_ids: List = None, blobs: io.TextIOBase = Non
88788888
end_word_index (int): If provided, will end the snippet at the index of (of words in the document) specified.
88798889
including_bounding_boxes (bool): If true, will include the bounding boxes of the snippets if they are available.
88808890
text (str): Plain text from which to retrieve snippets.
8891+
document_processing_config (DocumentProcessingConfig): The document processing configuration used to extract text when doc_ids or blobs are provided. If provided, this will override including_bounding_boxes parameter.
88818892

88828893
Returns:
88838894
list[DocumentRetrieverLookupResult]: The snippets found from the documents."""
8884-
return self._proxy_request('GetRelevantSnippets', 'POST', query_params={}, data={'docIds': doc_ids, 'query': query, 'documentRetrieverConfig': json.dumps(document_retriever_config.to_dict()) if hasattr(document_retriever_config, 'to_dict') else json.dumps(document_retriever_config), 'honorSentenceBoundary': honor_sentence_boundary, 'numRetrievalMarginWords': num_retrieval_margin_words, 'maxWordsPerSnippet': max_words_per_snippet, 'maxSnippetsPerDocument': max_snippets_per_document, 'startWordIndex': start_word_index, 'endWordIndex': end_word_index, 'includingBoundingBoxes': including_bounding_boxes, 'text': text}, files=blobs, parse_type=DocumentRetrieverLookupResult)
8895+
return self._proxy_request('GetRelevantSnippets', 'POST', query_params={}, data={'docIds': doc_ids, 'query': query, 'documentRetrieverConfig': json.dumps(document_retriever_config.to_dict()) if hasattr(document_retriever_config, 'to_dict') else json.dumps(document_retriever_config), 'honorSentenceBoundary': honor_sentence_boundary, 'numRetrievalMarginWords': num_retrieval_margin_words, 'maxWordsPerSnippet': max_words_per_snippet, 'maxSnippetsPerDocument': max_snippets_per_document, 'startWordIndex': start_word_index, 'endWordIndex': end_word_index, 'includingBoundingBoxes': including_bounding_boxes, 'text': text, 'documentProcessingConfig': json.dumps(document_processing_config.to_dict()) if hasattr(document_processing_config, 'to_dict') else json.dumps(document_processing_config)}, files=blobs, parse_type=DocumentRetrieverLookupResult)

abacusai/code_edits.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,18 @@ class CodeEdits(AbstractApiClass):
88
Args:
99
client (ApiClient): An authenticated API Client instance
1010
codeEdits (list[codeedit]): The code changes to be applied.
11+
codeChanges (list): The code changes to be applied.
1112
"""
1213

13-
def __init__(self, client, codeEdits=None):
14+
def __init__(self, client, codeEdits=None, codeChanges=None):
1415
super().__init__(client, None)
1516
self.code_edits = codeEdits
17+
self.code_changes = codeChanges
1618
self.deprecated_keys = {}
1719

1820
def __repr__(self):
19-
repr_dict = {f'code_edits': repr(self.code_edits)}
21+
repr_dict = {f'code_edits': repr(
22+
self.code_edits), f'code_changes': repr(self.code_changes)}
2023
class_name = "CodeEdits"
2124
repr_str = ',\n '.join([f'{key}={value}' for key, value in repr_dict.items(
2225
) if getattr(self, key, None) is not None and key not in self.deprecated_keys])
@@ -29,5 +32,6 @@ def to_dict(self):
2932
Returns:
3033
dict: The dict value representation of the class parameters
3134
"""
32-
resp = {'code_edits': self.code_edits}
35+
resp = {'code_edits': self.code_edits,
36+
'code_changes': self.code_changes}
3337
return {key: value for key, value in resp.items() if value is not None and key not in self.deprecated_keys}

0 commit comments

Comments
 (0)