Skip to content

Commit 1060c70

Browse files
committed
Version 1.4.42
1 parent 45b6567 commit 1060c70

303 files changed

Lines changed: 1729 additions & 319 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
@@ -43,6 +43,7 @@
4343
from .code_source import CodeSource
4444
from .code_suggestion_validation_response import CodeSuggestionValidationResponse
4545
from .code_summary_response import CodeSummaryResponse
46+
from .codellm_embedding_constants import CodellmEmbeddingConstants
4647
from .compute_point_info import ComputePointInfo
4748
from .concatenation_config import ConcatenationConfig
4849
from .constants_autocomplete_response import ConstantsAutocompleteResponse
@@ -255,4 +256,4 @@
255256
from .workflow_node_template import WorkflowNodeTemplate
256257

257258

258-
__version__ = "1.4.41"
259+
__version__ = "1.4.42"

abacusai/api_class/enums.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -515,6 +515,7 @@ class LLMName(ApiEnum):
515515
QWEN_2_5_32B_BASE = 'QWEN_2_5_32B_BASE'
516516
QWEN_2_5_72B = 'QWEN_2_5_72B'
517517
QWQ_32B = 'QWQ_32B'
518+
QWEN3_235B_A22B = 'QWEN3_235B_A22B'
518519
GEMINI_1_5_FLASH = 'GEMINI_1_5_FLASH'
519520
XAI_GROK = 'XAI_GROK'
520521
XAI_GROK_3 = 'XAI_GROK_3'

abacusai/client.py

Lines changed: 23 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -661,7 +661,7 @@ class BaseApiClient:
661661
client_options (ClientOptions): Optional API client configurations
662662
skip_version_check (bool): If true, will skip checking the server's current API version on initializing the client
663663
"""
664-
client_version = '1.4.41'
664+
client_version = '1.4.42'
665665

666666
def __init__(self, api_key: str = None, server: str = None, client_options: ClientOptions = None, skip_version_check: bool = False, include_tb: bool = False):
667667
self.api_key = api_key
@@ -857,6 +857,13 @@ def _proxy_request(self, name: str, method: str = 'POST', query_params: dict = N
857857
if deployment_id:
858858
query_params = {**(query_params or {}),
859859
'environmentDeploymentId': deployment_id}
860+
caller = self._get_agent_caller()
861+
request_id = self._get_agent_app_request_id()
862+
if caller and request_id:
863+
if get_object_from_context(self, _request_context, 'is_agent', bool):
864+
query_params = {**(query_params or {}), 'isAgent': True}
865+
if get_object_from_context(self, _request_context, 'is_agent_api', bool):
866+
query_params = {**(query_params or {}), 'isAgentApi': True}
860867
endpoint = self.proxy_endpoint
861868
if endpoint is None:
862869
raise Exception(
@@ -1554,17 +1561,18 @@ def list_application_connector_objects(self, application_connector_id: str) -> l
15541561
application_connector_id (str): Unique string identifier for the application connector."""
15551562
return self._call_api('listApplicationConnectorObjects', 'GET', query_params={'applicationConnectorId': application_connector_id})
15561563

1557-
def get_connector_auth(self, service: Union[ApplicationConnectorType, str] = None, application_connector_id: str = None, scopes: List = None) -> ApplicationConnector:
1564+
def get_connector_auth(self, service: Union[ApplicationConnectorType, str] = None, application_connector_id: str = None, scopes: List = None, is_database_connector: bool = None) -> ApplicationConnector:
15581565
"""Get the authentication details for a given connector. For user level connectors, the service is required. For org level connectors, the application_connector_id is required.
15591566

15601567
Args:
15611568
service (ApplicationConnectorType): The service name.
15621569
application_connector_id (str): The unique ID associated with the connector.
15631570
scopes (List): The scopes to request for the connector.
1571+
is_database_connector (bool): Whether the connector is a database connector.
15641572

15651573
Returns:
15661574
ApplicationConnector: The application connector with the authentication details."""
1567-
return self._call_api('getConnectorAuth', 'GET', query_params={'service': service, 'applicationConnectorId': application_connector_id, 'scopes': scopes}, parse_type=ApplicationConnector)
1575+
return self._call_api('getConnectorAuth', 'GET', query_params={'service': service, 'applicationConnectorId': application_connector_id, 'scopes': scopes, 'isDatabaseConnector': is_database_connector}, parse_type=ApplicationConnector)
15681576

15691577
def list_streaming_connectors(self) -> List[StreamingConnector]:
15701578
"""Retrieves a list of all streaming connectors along with their corresponding attributes.
@@ -2687,7 +2695,7 @@ def list_chat_sessions(self, most_recent_per_project: bool = False) -> ChatSessi
26872695
ChatSession: The chat sessions with Data Science Co-pilot"""
26882696
return self._call_api('listChatSessions', 'GET', query_params={'mostRecentPerProject': most_recent_per_project}, parse_type=ChatSession)
26892697

2690-
def get_deployment_conversation(self, deployment_conversation_id: str = None, external_session_id: str = None, deployment_id: str = None, filter_intermediate_conversation_events: bool = True, get_unused_document_uploads: bool = False) -> DeploymentConversation:
2698+
def get_deployment_conversation(self, deployment_conversation_id: str = None, external_session_id: str = None, deployment_id: str = None, filter_intermediate_conversation_events: bool = True, get_unused_document_uploads: bool = False, start: int = None, limit: int = None) -> DeploymentConversation:
26912699
"""Gets a deployment conversation.
26922700

26932701
Args:
@@ -2696,10 +2704,12 @@ def get_deployment_conversation(self, deployment_conversation_id: str = None, ex
26962704
deployment_id (str): The deployment this conversation belongs to. This is required if not logged in.
26972705
filter_intermediate_conversation_events (bool): If true, intermediate conversation events will be filtered out. Default is true.
26982706
get_unused_document_uploads (bool): If true, unused document uploads will be returned. Default is false.
2707+
start (int): The start index of the conversation.
2708+
limit (int): The limit of the conversation.
26992709

27002710
Returns:
27012711
DeploymentConversation: The deployment conversation."""
2702-
return self._proxy_request('getDeploymentConversation', 'GET', query_params={'deploymentConversationId': deployment_conversation_id, 'externalSessionId': external_session_id, 'deploymentId': deployment_id, 'filterIntermediateConversationEvents': filter_intermediate_conversation_events, 'getUnusedDocumentUploads': get_unused_document_uploads}, parse_type=DeploymentConversation, is_sync=True)
2712+
return self._proxy_request('getDeploymentConversation', 'GET', query_params={'deploymentConversationId': deployment_conversation_id, 'externalSessionId': external_session_id, 'deploymentId': deployment_id, 'filterIntermediateConversationEvents': filter_intermediate_conversation_events, 'getUnusedDocumentUploads': get_unused_document_uploads, 'start': start, 'limit': limit}, parse_type=DeploymentConversation, is_sync=True)
27032713

27042714
def list_deployment_conversations(self, deployment_id: str = None, external_application_id: str = None, conversation_type: Union[DeploymentConversationType, str] = None, fetch_last_llm_info: bool = False, limit: int = None, search: str = None) -> List[DeploymentConversation]:
27052715
"""Lists all conversations for the given deployment and current user.
@@ -3344,7 +3354,8 @@ def create_python_function_from_function(self,
33443354
function: callable,
33453355
function_variable_mappings: list = None,
33463356
package_requirements: list = None,
3347-
function_type: str = PythonFunctionType.FEATURE_GROUP.value):
3357+
function_type: str = PythonFunctionType.FEATURE_GROUP.value,
3358+
description: str = None):
33483359
"""
33493360
Creates a custom Python function
33503361

@@ -3354,6 +3365,7 @@ def create_python_function_from_function(self,
33543365
function_variable_mappings (List<PythonFunctionArguments>): List of Python function arguments.
33553366
package_requirements (List): List of package requirement strings. For example: ['numpy==1.2.3', 'pandas>=1.4.0'].
33563367
function_type (PythonFunctionType): Type of Python function to create. Default is FEATURE_GROUP, but can also be PLOTLY_FIG.
3368+
description (str): Description of the Python function.
33573369
"""
33583370
function_source = None
33593371
python_function_name = None
@@ -3368,7 +3380,8 @@ def create_python_function_from_function(self,
33683380
function_name=python_function_name,
33693381
function_variable_mappings=function_variable_mappings,
33703382
package_requirements=package_requirements,
3371-
function_type=function_type)
3383+
function_type=function_type,
3384+
description=description)
33723385

33733386
def create_feature_group_from_python_function(self, function: callable, table_name: str, input_tables: list = None, python_function_name: str = None, python_function_bindings: list = None, cpu_size: str = None, memory: int = None, package_requirements: list = None, included_modules: list = None):
33743387
"""
@@ -4148,11 +4161,11 @@ def streaming_evaluate_prompt(self, prompt: str = None, system_message: str = No
41484161
if caller and request_id:
41494162
is_agent = get_object_from_context(
41504163
self, _request_context, 'is_agent', bool)
4151-
is_api = get_object_from_context(
4164+
is_agent_api = get_object_from_context(
41524165
self, _request_context, 'is_agent_api', bool)
41534166

4154-
result = self._stream_llm_call(prompt=prompt, system_message=system_message, llm_name=llm_name, max_tokens=max_tokens, temperature=temperature,
4155-
messages=messages, response_type=response_type, json_response_schema=json_response_schema, section_key=section_key, is_agent=is_agent, is_api=is_api)
4167+
result = self._stream_llm_call(prompt=prompt, system_message=system_message, llm_name=llm_name, max_tokens=max_tokens, temperature=temperature, messages=messages,
4168+
response_type=response_type, json_response_schema=json_response_schema, section_key=section_key, is_agent=is_agent, is_agent_api=is_agent_api)
41564169
else:
41574170
result = self.evaluate_prompt(prompt, system_message=system_message, llm_name=llm_name, max_tokens=max_tokens,
41584171
temperature=temperature, messages=messages, response_type=response_type, json_response_schema=json_response_schema).content

abacusai/code_embeddings.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,18 @@ class CodeEmbeddings(AbstractApiClass):
88
Args:
99
client (ApiClient): An authenticated API Client instance
1010
embeddings (dict): A dictionary mapping the file name to its embeddings.
11+
chunkingScheme (str): The scheme used for chunking the embeddings.
1112
"""
1213

13-
def __init__(self, client, embeddings=None):
14+
def __init__(self, client, embeddings=None, chunkingScheme=None):
1415
super().__init__(client, None)
1516
self.embeddings = embeddings
17+
self.chunking_scheme = chunkingScheme
1618
self.deprecated_keys = {}
1719

1820
def __repr__(self):
19-
repr_dict = {f'embeddings': repr(self.embeddings)}
21+
repr_dict = {f'embeddings': repr(
22+
self.embeddings), f'chunking_scheme': repr(self.chunking_scheme)}
2023
class_name = "CodeEmbeddings"
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 = {'embeddings': self.embeddings}
35+
resp = {'embeddings': self.embeddings,
36+
'chunking_scheme': self.chunking_scheme}
3337
return {key: value for key, value in resp.items() if value is not None and key not in self.deprecated_keys}
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
from .return_class import AbstractApiClass
2+
3+
4+
class CodellmEmbeddingConstants(AbstractApiClass):
5+
"""
6+
A dictionary of constants to be used in the autocomplete.
7+
8+
Args:
9+
client (ApiClient): An authenticated API Client instance
10+
maxSupportedWorkspaceFiles (int): Max supported workspace files
11+
maxSupportedWorkspaceChunks (int): Max supported workspace chunks
12+
maxConcurrentRequests (int): Max concurrent requests
13+
fileExtensionToChunkingScheme (dict): Map between the file extensions and their chunking schema
14+
idleTimeoutSeconds (int): The idle timeout without any activity before the workspace is refreshed.
15+
"""
16+
17+
def __init__(self, client, maxSupportedWorkspaceFiles=None, maxSupportedWorkspaceChunks=None, maxConcurrentRequests=None, fileExtensionToChunkingScheme=None, idleTimeoutSeconds=None):
18+
super().__init__(client, None)
19+
self.max_supported_workspace_files = maxSupportedWorkspaceFiles
20+
self.max_supported_workspace_chunks = maxSupportedWorkspaceChunks
21+
self.max_concurrent_requests = maxConcurrentRequests
22+
self.file_extension_to_chunking_scheme = fileExtensionToChunkingScheme
23+
self.idle_timeout_seconds = idleTimeoutSeconds
24+
self.deprecated_keys = {}
25+
26+
def __repr__(self):
27+
repr_dict = {f'max_supported_workspace_files': repr(self.max_supported_workspace_files), f'max_supported_workspace_chunks': repr(self.max_supported_workspace_chunks), f'max_concurrent_requests': repr(
28+
self.max_concurrent_requests), f'file_extension_to_chunking_scheme': repr(self.file_extension_to_chunking_scheme), f'idle_timeout_seconds': repr(self.idle_timeout_seconds)}
29+
class_name = "CodellmEmbeddingConstants"
30+
repr_str = ',\n '.join([f'{key}={value}' for key, value in repr_dict.items(
31+
) if getattr(self, key, None) is not None and key not in self.deprecated_keys])
32+
return f"{class_name}({repr_str})"
33+
34+
def to_dict(self):
35+
"""
36+
Get a dict representation of the parameters in this class
37+
38+
Returns:
39+
dict: The dict value representation of the class parameters
40+
"""
41+
resp = {'max_supported_workspace_files': self.max_supported_workspace_files, 'max_supported_workspace_chunks': self.max_supported_workspace_chunks,
42+
'max_concurrent_requests': self.max_concurrent_requests, 'file_extension_to_chunking_scheme': self.file_extension_to_chunking_scheme, 'idle_timeout_seconds': self.idle_timeout_seconds}
43+
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)