Skip to content

Commit 8d3ff03

Browse files
committed
Version 1.4.33
1 parent 3212778 commit 8d3ff03

288 files changed

Lines changed: 2209 additions & 511 deletions

File tree

Some content is hidden

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

abacusai/__init__.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
from .code_edit_response import CodeEditResponse
3939
from .code_edits import CodeEdits
4040
from .code_source import CodeSource
41+
from .code_suggestion_validation_response import CodeSuggestionValidationResponse
4142
from .compute_point_info import ComputePointInfo
4243
from .concatenation_config import ConcatenationConfig
4344
from .constants_autocomplete_response import ConstantsAutocompleteResponse
@@ -237,4 +238,4 @@
237238
from .workflow_node_template import WorkflowNodeTemplate
238239

239240

240-
__version__ = "1.4.32"
241+
__version__ = "1.4.33"

abacusai/api_class/dataset_application_connector.py

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -222,6 +222,26 @@ def __post_init__(self):
222222
self.application_connector_type = enums.ApplicationConnectorType.FRESHSERVICE
223223

224224

225+
@dataclasses.dataclass
226+
class SftpDatasetConfig(ApplicationConnectorDatasetConfig):
227+
"""
228+
Dataset config for SFTP Application Connector
229+
230+
Args:
231+
location (str): The regex location of the files to fetch
232+
csv_delimiter (str): If the file format is CSV, use a specific csv delimiter
233+
extract_bounding_boxes (bool): Signifies whether to extract bounding boxes out of the documents. Only valid if is_documentset if True
234+
merge_file_schemas (bool): Signifies if the merge file schema policy is enabled. Not applicable if is_documentset is True
235+
"""
236+
location: str = dataclasses.field(default=None)
237+
csv_delimiter: str = dataclasses.field(default=None)
238+
extract_bounding_boxes: bool = dataclasses.field(default=False) # TODO: Deprecate in favour of document_processing_config
239+
merge_file_schemas: bool = dataclasses.field(default=False)
240+
241+
def __post_init__(self):
242+
self.application_connector_type = enums.ApplicationConnectorType.SFTPAPPLICATION
243+
244+
225245
@dataclasses.dataclass
226246
class _ApplicationConnectorDatasetConfigFactory(_ApiClassFactory):
227247
config_abstract_class = ApplicationConnectorDatasetConfig
@@ -238,4 +258,5 @@ class _ApplicationConnectorDatasetConfigFactory(_ApiClassFactory):
238258
enums.ApplicationConnectorType.FRESHSERVICE: FreshserviceDatasetConfig,
239259
enums.ApplicationConnectorType.TEAMSSCRAPER: TeamsScraperDatasetConfig,
240260
enums.ApplicationConnectorType.BOX: BoxDatasetConfig,
261+
enums.ApplicationConnectorType.SFTPAPPLICATION: SftpDatasetConfig,
241262
}

abacusai/api_class/enums.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -414,6 +414,7 @@ class ApplicationConnectorType(ApiEnum):
414414
GITHUBUSER = 'GITHUBUSER'
415415
OKTASAML = 'OKTASAML'
416416
BOX = 'BOX'
417+
SFTPAPPLICATION = 'SFTPAPPLICATION'
417418

418419

419420
class StreamingConnectorType(ApiEnum):
@@ -482,6 +483,7 @@ class LLMName(ApiEnum):
482483
CLAUDE_V3_SONNET = 'CLAUDE_V3_SONNET'
483484
CLAUDE_V3_HAIKU = 'CLAUDE_V3_HAIKU'
484485
CLAUDE_V3_5_SONNET = 'CLAUDE_V3_5_SONNET'
486+
CLAUDE_V3_7_SONNET = 'CLAUDE_V3_7_SONNET'
485487
CLAUDE_V3_5_HAIKU = 'CLAUDE_V3_5_HAIKU'
486488
GEMINI_1_5_PRO = 'GEMINI_1_5_PRO'
487489
GEMINI_2_FLASH = 'GEMINI_2_FLASH'
@@ -726,3 +728,4 @@ class DeploymentConversationType(ApiEnum):
726728
CHAT_LLM_TASK = 'CHAT_LLM_TASK'
727729
COMPUTER_AGENT = 'COMPUTER_AGENT'
728730
SEARCH_LLM = 'SEARCH_LLM'
731+
APP_LLM = 'APP_LLM'

abacusai/api_client_utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -613,7 +613,7 @@ def tokens_to_text(tokens: List[dict]) -> str:
613613
def combine_doc_info(group):
614614
page_infos = group.to_dict(orient='records')
615615
document_data = {
616-
cls.METADATA: [{cls.HEIGHT: page.get(cls.HEIGHT, None), cls.WIDTH: page.get(cls.WIDTH, None), cls.PAGE: page_no + 1, cls.MARKDOWN_FEATURES: page.get(cls.MARKDOWN_FEATURES)}
616+
cls.METADATA: [{cls.HEIGHT: page.get(cls.HEIGHT, None), cls.WIDTH: page.get(cls.WIDTH, None), cls.PAGE: page_no, cls.MARKDOWN_FEATURES: page.get(cls.MARKDOWN_FEATURES)}
617617
for page_no, page in enumerate(page_infos)],
618618
cls.TOKENS: [token for page in page_infos for token in page.get(cls.TOKENS) or []],
619619
# default to embedded text

abacusai/chatllm_task.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,11 @@ class ChatllmTask(AbstractApiClass):
1616
deploymentConversationId (str): The deployment conversation id associated with the chatllm task.
1717
enableEmailAlerts (bool): Whether email alerts are enabled for the chatllm task.
1818
email (str): The email to send alerts to.
19+
numUnreadTaskInstances (int): The number of unread task instances for the chatllm task.
1920
computePointsUsed (int): The compute points used for the chatllm task.
20-
wasSeen (bool): Whether the chatllm task has been seen.
2121
"""
2222

23-
def __init__(self, client, chatllmTaskId=None, name=None, instructions=None, lifecycle=None, scheduleInfo=None, externalApplicationId=None, deploymentConversationId=None, enableEmailAlerts=None, email=None, computePointsUsed=None, wasSeen=None):
23+
def __init__(self, client, chatllmTaskId=None, name=None, instructions=None, lifecycle=None, scheduleInfo=None, externalApplicationId=None, deploymentConversationId=None, enableEmailAlerts=None, email=None, numUnreadTaskInstances=None, computePointsUsed=None):
2424
super().__init__(client, chatllmTaskId)
2525
self.chatllm_task_id = chatllmTaskId
2626
self.name = name
@@ -31,13 +31,13 @@ def __init__(self, client, chatllmTaskId=None, name=None, instructions=None, lif
3131
self.deployment_conversation_id = deploymentConversationId
3232
self.enable_email_alerts = enableEmailAlerts
3333
self.email = email
34+
self.num_unread_task_instances = numUnreadTaskInstances
3435
self.compute_points_used = computePointsUsed
35-
self.was_seen = wasSeen
3636
self.deprecated_keys = {}
3737

3838
def __repr__(self):
39-
repr_dict = {f'chatllm_task_id': repr(self.chatllm_task_id), f'name': repr(self.name), f'instructions': repr(self.instructions), f'lifecycle': repr(self.lifecycle), f'schedule_info': repr(self.schedule_info), f'external_application_id': repr(
40-
self.external_application_id), f'deployment_conversation_id': repr(self.deployment_conversation_id), f'enable_email_alerts': repr(self.enable_email_alerts), f'email': repr(self.email), f'compute_points_used': repr(self.compute_points_used), f'was_seen': repr(self.was_seen)}
39+
repr_dict = {f'chatllm_task_id': repr(self.chatllm_task_id), f'name': repr(self.name), f'instructions': repr(self.instructions), f'lifecycle': repr(self.lifecycle), f'schedule_info': repr(self.schedule_info), f'external_application_id': repr(self.external_application_id), f'deployment_conversation_id': repr(
40+
self.deployment_conversation_id), f'enable_email_alerts': repr(self.enable_email_alerts), f'email': repr(self.email), f'num_unread_task_instances': repr(self.num_unread_task_instances), f'compute_points_used': repr(self.compute_points_used)}
4141
class_name = "ChatllmTask"
4242
repr_str = ',\n '.join([f'{key}={value}' for key, value in repr_dict.items(
4343
) if getattr(self, key, None) is not None and key not in self.deprecated_keys])
@@ -51,5 +51,5 @@ def to_dict(self):
5151
dict: The dict value representation of the class parameters
5252
"""
5353
resp = {'chatllm_task_id': self.chatllm_task_id, 'name': self.name, 'instructions': self.instructions, 'lifecycle': self.lifecycle, 'schedule_info': self.schedule_info, 'external_application_id': self.external_application_id,
54-
'deployment_conversation_id': self.deployment_conversation_id, 'enable_email_alerts': self.enable_email_alerts, 'email': self.email, 'compute_points_used': self.compute_points_used, 'was_seen': self.was_seen}
54+
'deployment_conversation_id': self.deployment_conversation_id, 'enable_email_alerts': self.enable_email_alerts, 'email': self.email, 'num_unread_task_instances': self.num_unread_task_instances, 'compute_points_used': self.compute_points_used}
5555
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: 31 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -652,7 +652,7 @@ class BaseApiClient:
652652
client_options (ClientOptions): Optional API client configurations
653653
skip_version_check (bool): If true, will skip checking the server's current API version on initializing the client
654654
"""
655-
client_version = '1.4.32'
655+
client_version = '1.4.33'
656656

657657
def __init__(self, api_key: str = None, server: str = None, client_options: ClientOptions = None, skip_version_check: bool = False, include_tb: bool = False):
658658
self.api_key = api_key
@@ -3983,7 +3983,7 @@ def execute_chatllm_computer_streaming(self, computer_id: str, prompt: str, is_t
39833983
text (str): The text responses from the computer.
39843984
"""
39853985
request_id = self._get_agent_app_request_id()
3986-
caller = self._get_agent_async_app_caller()
3986+
caller = self._get_agent_caller()
39873987
proxy_caller = self._is_proxy_app_caller()
39883988

39893989
if not request_id or not caller:
@@ -4049,7 +4049,7 @@ def streaming_evaluate_prompt(self, prompt: str = None, system_message: str = No
40494049
Returns:
40504050
text (str): The response from the model.
40514051
"""
4052-
caller = self._get_agent_async_app_caller()
4052+
caller = self._get_agent_caller()
40534053
request_id = self._get_agent_app_request_id()
40544054
if prompt and not isinstance(prompt, str):
40554055
raise ValueError('prompt must be a string')
@@ -4113,9 +4113,9 @@ def _get_agent_app_request_id(self):
41134113
"""
41144114
return get_object_from_context(self, _request_context, 'request_id', str)
41154115

4116-
def _get_agent_async_app_caller(self):
4116+
def _get_agent_caller(self):
41174117
"""
4118-
Gets the caller for the current request context of async app. Applicable within a AIAgent execute function.
4118+
Gets the caller for the current request context. Applicable within a AIAgent execute function.
41194119

41204120
Returns:
41214121
str: The caller for the current request being processed by the Agent.
@@ -4124,13 +4124,22 @@ def _get_agent_async_app_caller(self):
41244124

41254125
def _is_proxy_app_caller(self):
41264126
"""
4127-
Gets the caller for the current request context of async app. Applicable within a AIAgent execute function.
4127+
Checks if the caller is cluster-proxy app.
41284128

41294129
Returns:
4130-
bool: True if the caller is proxy app.
4130+
bool: True if the caller is cluster-proxy app.
41314131
"""
41324132
return get_object_from_context(self, _request_context, 'proxy_app_caller', str) is not None
41334133

4134+
def _is_async_app_caller(self):
4135+
"""
4136+
Checks if the caller is async app.
4137+
4138+
Returns:
4139+
bool: True if the caller is async app.
4140+
"""
4141+
return get_object_from_context(self, _request_context, 'async_app_caller', str) is not None
4142+
41344143
def stream_message(self, message: str, is_transient: bool = False) -> None:
41354144
"""
41364145
Streams a message to the current request context. Applicable within a AIAgent execute function.
@@ -4141,7 +4150,7 @@ def stream_message(self, message: str, is_transient: bool = False) -> None:
41414150
is_transient (bool): If True, the message will be marked as transient and will not be persisted on reload in external chatllm UI. Transient messages are useful for streaming interim updates or results.
41424151
"""
41434152
request_id = self._get_agent_app_request_id()
4144-
caller = self._get_agent_async_app_caller()
4153+
caller = self._get_agent_caller()
41454154
proxy_caller = self._is_proxy_app_caller()
41464155
if request_id and caller:
41474156
extra_args = {'stream_type': StreamType.MESSAGE.value,
@@ -4163,7 +4172,7 @@ def stream_section_output(self, section_key: str, value: str) -> None:
41634172
value (Any): The output contents.
41644173
"""
41654174
request_id = self._get_agent_app_request_id()
4166-
caller = self._get_agent_async_app_caller()
4175+
caller = self._get_agent_caller()
41674176
proxy_caller = self._is_proxy_app_caller()
41684177
if _is_json_serializable(value):
41694178
message_args = {'id': section_key,
@@ -4189,7 +4198,7 @@ def stream_response_section(self, response_section: ResponseSection):
41894198
response_section (ResponseSection): The response section to be streamed.
41904199
"""
41914200
request_id = self._get_agent_app_request_id()
4192-
caller = self._get_agent_async_app_caller()
4201+
caller = self._get_agent_caller()
41934202
proxy_caller = self._is_proxy_app_caller()
41944203
if request_id and caller:
41954204
segment = response_section.to_dict()
@@ -4203,7 +4212,7 @@ def stream_response_section(self, response_section: ResponseSection):
42034212

42044213
def _stream_llm_call(self, section_key=None, **kwargs):
42054214
request_id = self._get_agent_app_request_id()
4206-
caller = self._get_agent_async_app_caller()
4215+
caller = self._get_agent_caller()
42074216
proxy_caller = self._is_proxy_app_caller()
42084217
if not request_id or not caller:
42094218
logging.info('Please use evaluate_prompt for local testing.')
@@ -8010,7 +8019,7 @@ def get_feature_group_row_process_logs_by_key(self, deployment_id: str, primary_
80108019
FeatureGroupRowProcessLogs: An object representing the logs for the feature group row process"""
80118020
return self._call_api('getFeatureGroupRowProcessLogsByKey', 'POST', query_params={'deploymentId': deployment_id}, body={'primaryKeyValue': primary_key_value}, parse_type=FeatureGroupRowProcessLogs)
80128021

8013-
def create_python_function(self, name: str, source_code: str = None, function_name: str = None, function_variable_mappings: List = None, package_requirements: list = None, function_type: str = 'FEATURE_GROUP', description: str = None, examples: dict = None) -> PythonFunction:
8022+
def create_python_function(self, name: str, source_code: str = None, function_name: str = None, function_variable_mappings: List = None, package_requirements: list = None, function_type: str = 'FEATURE_GROUP', description: str = None, examples: dict = None, user_level_connectors: Dict = None, org_level_connectors: list = None, output_variable_mappings: List = None) -> PythonFunction:
80148023
"""Creates a custom Python function that is reusable.
80158024

80168025
Args:
@@ -8021,13 +8030,16 @@ def create_python_function(self, name: str, source_code: str = None, function_na
80218030
package_requirements (list): List of package requirement strings. For example: ['numpy==1.2.3', 'pandas>=1.4.0'].
80228031
function_type (str): Type of Python function to create. Default is FEATURE_GROUP, but can also be PLOTLY_FIG.
80238032
description (str): Description of the Python function. This should include details about the function's purpose, expected inputs and outputs, and any important usage considerations or limitations.
8024-
examples (dict): Dictionary containing example use cases and anti-patterns. Should include 'positive_examples' showing recommended usage and 'negative_examples' showing cases to avoid.
8033+
examples (dict): Dictionary containing example use cases and anti-patterns. Should include 'positive_examples' showing recommended usage and 'negative_examples' showing cases to avoid.])
8034+
user_level_connectors (Dict): Dictionary containing user level connectors.
8035+
org_level_connectors (list): List containing organization level connectors.
8036+
output_variable_mappings (List): List of output variable mappings that defines the elements of the function's return value.
80258037

80268038
Returns:
80278039
PythonFunction: The Python function that can be used (e.g. for feature group transform)."""
8028-
return self._call_api('createPythonFunction', 'POST', query_params={}, body={'name': name, 'sourceCode': source_code, 'functionName': function_name, 'functionVariableMappings': function_variable_mappings, 'packageRequirements': package_requirements, 'functionType': function_type, 'description': description, 'examples': examples}, parse_type=PythonFunction)
8040+
return self._call_api('createPythonFunction', 'POST', query_params={}, body={'name': name, 'sourceCode': source_code, 'functionName': function_name, 'functionVariableMappings': function_variable_mappings, 'packageRequirements': package_requirements, 'functionType': function_type, 'description': description, 'examples': examples, 'userLevelConnectors': user_level_connectors, 'orgLevelConnectors': org_level_connectors, 'outputVariableMappings': output_variable_mappings}, parse_type=PythonFunction)
80298041

8030-
def update_python_function(self, name: str, source_code: str = None, function_name: str = None, function_variable_mappings: List = None, package_requirements: list = None, description: str = None, examples: dict = None) -> PythonFunction:
8042+
def update_python_function(self, name: str, source_code: str = None, function_name: str = None, function_variable_mappings: List = None, package_requirements: list = None, description: str = None, examples: dict = None, user_level_connectors: Dict = None, org_level_connectors: List = None, output_variable_mappings: List = None) -> PythonFunction:
80318043
"""Update custom python function with user inputs for the given python function.
80328044

80338045
Args:
@@ -8038,10 +8050,13 @@ def update_python_function(self, name: str, source_code: str = None, function_na
80388050
package_requirements (list): List of package requirement strings. For example: ['numpy==1.2.3', 'pandas>=1.4.0'].
80398051
description (str): Description of the Python function. This should include details about the function's purpose, expected inputs and outputs, and any important usage considerations or limitations.
80408052
examples (dict): Dictionary containing example use cases and anti-patterns. Should include 'positive_examples' showing recommended usage and 'negative_examples' showing cases to avoid.
8053+
user_level_connectors (Dict): Dictionary containing user level connectors.
8054+
org_level_connectors (List): List of organization level connectors.
8055+
output_variable_mappings (List): List of output variable mappings that defines the elements of the function's return value.
80418056

80428057
Returns:
80438058
PythonFunction: The Python function object."""
8044-
return self._call_api('updatePythonFunction', 'PATCH', query_params={}, body={'name': name, 'sourceCode': source_code, 'functionName': function_name, 'functionVariableMappings': function_variable_mappings, 'packageRequirements': package_requirements, 'description': description, 'examples': examples}, parse_type=PythonFunction)
8059+
return self._call_api('updatePythonFunction', 'PATCH', query_params={}, body={'name': name, 'sourceCode': source_code, 'functionName': function_name, 'functionVariableMappings': function_variable_mappings, 'packageRequirements': package_requirements, 'description': description, 'examples': examples, 'userLevelConnectors': user_level_connectors, 'orgLevelConnectors': org_level_connectors, 'outputVariableMappings': output_variable_mappings}, parse_type=PythonFunction)
80458060

80468061
def delete_python_function(self, name: str):
80478062
"""Removes an existing Python function.

0 commit comments

Comments
 (0)