Skip to content

Commit 849d3ba

Browse files
committed
Version 1.4.40
1 parent 24cf6f9 commit 849d3ba

File tree

289 files changed

+1700
-188
lines changed

Some content is hidden

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

289 files changed

+1700
-188
lines changed

Diff for: abacusai/__init__.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
from .chatllm_project import ChatllmProject
3232
from .chatllm_referral_invite import ChatllmReferralInvite
3333
from .chatllm_task import ChatllmTask
34-
from .client import AgentResponse, ApiClient, ApiException, ClientOptions, ReadOnlyClient, _request_context
34+
from .client import AgentResponse, ApiClient, ApiException, ClientOptions, ReadOnlyClient, ToolResponse, _request_context
3535
from .code_agent_response import CodeAgentResponse
3636
from .code_autocomplete_response import CodeAutocompleteResponse
3737
from .code_bot import CodeBot
@@ -127,6 +127,7 @@
127127
from .hosted_app import HostedApp
128128
from .hosted_app_container import HostedAppContainer
129129
from .hosted_app_file_read import HostedAppFileRead
130+
from .hosted_artifact import HostedArtifact
130131
from .hosted_model_token import HostedModelToken
131132
from .hume_voice import HumeVoice
132133
from .image_gen_settings import ImageGenSettings
@@ -245,4 +246,4 @@
245246
from .workflow_node_template import WorkflowNodeTemplate
246247

247248

248-
__version__ = "1.4.39"
249+
__version__ = "1.4.40"

Diff for: abacusai/api_class/ai_agents.py

+24
Original file line numberDiff line numberDiff line change
@@ -488,6 +488,18 @@ def from_template(cls, template_name: str, name: str, configs: dict = None, inpu
488488

489489
@classmethod
490490
def from_tool(cls, tool_name: str, name: str, configs: dict = None, input_mappings: Union[Dict[str, WorkflowNodeInputMapping], List[WorkflowNodeInputMapping]] = None, input_schema: Union[List[str], WorkflowNodeInputSchema] = None, output_schema: Union[List[str], WorkflowNodeOutputSchema] = None):
491+
"""
492+
Creates and returns a WorkflowGraphNode based on an available user created tool.
493+
Note: DO NOT specify the output mapping for the tool; it will be inferred automatically. Doing so will raise an error.
494+
495+
Args:
496+
tool_name: The name of the tool. There should already be a tool created in the platform with tool_name.
497+
name: The name to assign to the WorkflowGraphNode instance.
498+
configs (optional): The configuration state of the tool to use (if necessary). If not specified, will use the tool's default configuration.
499+
input_mappings (optional): The WorkflowNodeInputMappings for this node.
500+
input_schema (optional): The WorkflowNodeInputSchema for this node.
501+
output_schema (optional): The WorkflowNodeOutputSchema for this node.
502+
"""
491503
node = cls.from_template(
492504
template_name=tool_name,
493505
name=name,
@@ -501,6 +513,18 @@ def from_tool(cls, tool_name: str, name: str, configs: dict = None, input_mappin
501513

502514
@classmethod
503515
def from_system_tool(cls, tool_name: str, name: str, configs: dict = None, input_mappings: Union[Dict[str, WorkflowNodeInputMapping], List[WorkflowNodeInputMapping]] = None, input_schema: Union[List[str], WorkflowNodeInputSchema] = None, output_schema: Union[List[str], WorkflowNodeOutputSchema] = None):
516+
"""
517+
Creates and returns a WorkflowGraphNode based on the name of an available system tool.
518+
Note: DO NOT specify the output mapping for the tool; it will be inferred automatically. Doing so will raise an error.
519+
520+
Args:
521+
tool_name: The name of the tool. There should already be a tool created in the platform with tool_name.
522+
name: The name to assign to the WorkflowGraphNode instance.
523+
configs (optional): The configuration state of the tool to use (if necessary). If not specified, will use the tool's default configuration.
524+
input_mappings (optional): The WorkflowNodeInputMappings for this node.
525+
input_schema (optional): The WorkflowNodeInputSchema for this node.
526+
output_schema (optional): The WorkflowNodeOutputSchema for this node.
527+
"""
504528
node = cls.from_tool(tool_name, name, configs, input_mappings, input_schema, output_schema)
505529
node.template_metadata['is_system_tool'] = True
506530
return node

Diff for: abacusai/api_class/enums.py

+4
Original file line numberDiff line numberDiff line change
@@ -475,6 +475,8 @@ class LLMName(ApiEnum):
475475
OPENAI_GPT4O = 'OPENAI_GPT4O'
476476
OPENAI_GPT4O_MINI = 'OPENAI_GPT4O_MINI'
477477
OPENAI_O1_MINI = 'OPENAI_O1_MINI'
478+
OPENAI_GPT4_1 = 'OPENAI_GPT4_1'
479+
OPENAI_GPT4_1_MINI = 'OPENAI_GPT4_1_MINI'
478480
OPENAI_GPT3_5 = 'OPENAI_GPT3_5'
479481
OPENAI_GPT3_5_TEXT = 'OPENAI_GPT3_5_TEXT'
480482
LLAMA3_1_405B = 'LLAMA3_1_405B'
@@ -500,6 +502,8 @@ class LLMName(ApiEnum):
500502
QWQ_32B = 'QWQ_32B'
501503
GEMINI_1_5_FLASH = 'GEMINI_1_5_FLASH'
502504
XAI_GROK = 'XAI_GROK'
505+
XAI_GROK_3 = 'XAI_GROK_3'
506+
XAI_GROK_3_MINI = 'XAI_GROK_3_MINI'
503507
DEEPSEEK_V3 = 'DEEPSEEK_V3'
504508
DEEPSEEK_R1 = 'DEEPSEEK_R1'
505509

Diff for: abacusai/client.py

+17-6
Original file line numberDiff line numberDiff line change
@@ -320,6 +320,15 @@ def __getattr__(self, item):
320320
f"'{self.__class__.__name__}' object has no attribute '{item}'")
321321

322322

323+
class ToolResponse(AgentResponse):
324+
"""
325+
Response object for tool to support non-text response sections
326+
"""
327+
328+
def __init__(self, *args, **kwargs):
329+
super().__init__(*args, **kwargs)
330+
331+
323332
class ClientOptions:
324333
"""
325334
Options for configuring the ApiClient
@@ -652,7 +661,7 @@ class BaseApiClient:
652661
client_options (ClientOptions): Optional API client configurations
653662
skip_version_check (bool): If true, will skip checking the server's current API version on initializing the client
654663
"""
655-
client_version = '1.4.39'
664+
client_version = '1.4.40'
656665

657666
def __init__(self, api_key: str = None, server: str = None, client_options: ClientOptions = None, skip_version_check: bool = False, include_tb: bool = False):
658667
self.api_key = api_key
@@ -2962,7 +2971,7 @@ def create_dataset_from_pandas(self, feature_group_table_name: str, df: pd.DataF
29622971
table_name=feature_group_table_name, file_format='PARQUET')
29632972
return self._upload_from_pandas(upload, df)
29642973

2965-
def get_assignments_online_with_new_inputs(self, deployment_token: str, deployment_id: str, assignments_df: pd.DataFrame = None, constraints_df: pd.DataFrame = None, constraint_equations_df: pd.DataFrame = None, feature_mapping_dict: dict = None, solve_time_limit_seconds: float = None):
2974+
def get_assignments_online_with_new_inputs(self, deployment_token: str, deployment_id: str, assignments_df: pd.DataFrame = None, constraints_df: pd.DataFrame = None, constraint_equations_df: pd.DataFrame = None, feature_mapping_dict: dict = None, solve_time_limit_seconds: float = None, optimality_gap_limit: float = None):
29662975
"""
29672976
Get alternative positive assignments for given query. Optimal assignments are ignored and the alternative assignments are returned instead.
29682977

@@ -2974,6 +2983,7 @@ def get_assignments_online_with_new_inputs(self, deployment_token: str, deployme
29742983
constraint_equations_df (pd.DataFrame): A dataframe which tells us about the operator / constant / penalty etc of a constraint
29752984
This gives us some data which is needed to make sense of the constraints_df.
29762985
solve_time_limit_seconds (float): Maximum time in seconds to spend solving the query.
2986+
optimality_gap_limit (float): Optimality gap we want to come within, after which we accept the solution as valid. (0 means we only want an optimal solution). it is abs(best_solution_found - best_bound) / abs(best_solution_found)
29772987

29782988
Returns:
29792989
OptimizationAssignment: The assignments for a given query.
@@ -3012,7 +3022,7 @@ def _serialize_df_with_dtypes(df):
30123022
'feature_mapping_dict': feature_mapping_dict}
30133023

30143024
result = self.get_assignments_online_with_new_serialized_inputs(
3015-
deployment_token=deployment_token, deployment_id=deployment_id, query_data=query_data, solve_time_limit_seconds=solve_time_limit_seconds)
3025+
deployment_token=deployment_token, deployment_id=deployment_id, query_data=query_data, solve_time_limit_seconds=solve_time_limit_seconds, optimality_gap_limit=optimality_gap_limit)
30163026
return result
30173027

30183028
def create_dataset_version_from_pandas(self, table_name_or_id: str, df: pd.DataFrame, clean_column_names: bool = False) -> Dataset:
@@ -7570,17 +7580,18 @@ def get_alternative_assignments(self, deployment_token: str, deployment_id: str,
75707580
deployment_id, deployment_token) if deployment_token else None
75717581
return self._call_api('getAlternativeAssignments', 'POST', query_params={'deploymentToken': deployment_token, 'deploymentId': deployment_id}, body={'queryData': query_data, 'addConstraints': add_constraints, 'solveTimeLimitSeconds': solve_time_limit_seconds, 'bestAlternateOnly': best_alternate_only}, server_override=prediction_url)
75727582

7573-
def get_assignments_online_with_new_serialized_inputs(self, deployment_token: str, deployment_id: str, query_data: dict = None, solve_time_limit_seconds: float = None) -> Dict:
7583+
def get_assignments_online_with_new_serialized_inputs(self, deployment_token: str, deployment_id: str, query_data: dict = None, solve_time_limit_seconds: float = None, optimality_gap_limit: float = None) -> Dict:
75747584
"""Get assignments for given query, with new inputs
75757585

75767586
Args:
75777587
deployment_token (str): The deployment token used to authenticate access to created deployments. This token is only authorized to predict on deployments in this project, so it can be safely embedded in an application or website.
75787588
deployment_id (str): The unique identifier of a deployment created under the project.
75797589
query_data (dict): a dictionary with assignment, constraint and constraint_equations_df
7580-
solve_time_limit_seconds (float): Maximum time in seconds to spend solving the query."""
7590+
solve_time_limit_seconds (float): Maximum time in seconds to spend solving the query.
7591+
optimality_gap_limit (float): Optimality gap we want to come within, after which we accept the solution as valid. (0 means we only want an optimal solution). it is abs(best_solution_found - best_bound) / abs(best_solution_found)"""
75817592
prediction_url = self._get_prediction_endpoint(
75827593
deployment_id, deployment_token) if deployment_token else None
7583-
return self._call_api('getAssignmentsOnlineWithNewSerializedInputs', 'POST', query_params={'deploymentToken': deployment_token, 'deploymentId': deployment_id}, body={'queryData': query_data, 'solveTimeLimitSeconds': solve_time_limit_seconds}, server_override=prediction_url)
7594+
return self._call_api('getAssignmentsOnlineWithNewSerializedInputs', 'POST', query_params={'deploymentToken': deployment_token, 'deploymentId': deployment_id}, body={'queryData': query_data, 'solveTimeLimitSeconds': solve_time_limit_seconds, 'optimalityGapLimit': optimality_gap_limit}, server_override=prediction_url)
75847595

75857596
def check_constraints(self, deployment_token: str, deployment_id: str, query_data: dict) -> Dict:
75867597
"""Check for any constraints violated by the overrides.

Diff for: abacusai/deployment_conversation.py

+11-5
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
from .deployment_conversation_event import DeploymentConversationEvent
2+
from .hosted_artifact import HostedArtifact
23
from .return_class import AbstractApiClass
34

45

@@ -11,6 +12,7 @@ class DeploymentConversation(AbstractApiClass):
1112
deploymentConversationId (str): The unique identifier of the deployment conversation.
1213
name (str): The name of the deployment conversation.
1314
deploymentId (str): The deployment id associated with the deployment conversation.
15+
ownerUserId (str): The user id of the owner of the deployment conversation.
1416
createdAt (str): The timestamp at which the deployment conversation was created.
1517
lastEventCreatedAt (str): The timestamp at which the most recent corresponding deployment conversation event was created at.
1618
hasHistory (bool): Whether the deployment conversation has any history.
@@ -27,13 +29,15 @@ class DeploymentConversation(AbstractApiClass):
2729
searchSuggestions (list): The list of search suggestions for the conversation.
2830
chatllmTaskId (str): The chatllm task id associated with the deployment conversation.
2931
history (DeploymentConversationEvent): The history of the deployment conversation.
32+
hostedArtifacts (HostedArtifact): Artifacts that have been deployed by this conversation.
3033
"""
3134

32-
def __init__(self, client, deploymentConversationId=None, name=None, deploymentId=None, createdAt=None, lastEventCreatedAt=None, hasHistory=None, externalSessionId=None, regenerateAttempt=None, externalApplicationId=None, unusedDocumentUploadIds=None, humanizeInstructions=None, conversationWarning=None, conversationType=None, metadata=None, llmDisplayName=None, llmBotIcon=None, searchSuggestions=None, chatllmTaskId=None, history={}):
35+
def __init__(self, client, deploymentConversationId=None, name=None, deploymentId=None, ownerUserId=None, createdAt=None, lastEventCreatedAt=None, hasHistory=None, externalSessionId=None, regenerateAttempt=None, externalApplicationId=None, unusedDocumentUploadIds=None, humanizeInstructions=None, conversationWarning=None, conversationType=None, metadata=None, llmDisplayName=None, llmBotIcon=None, searchSuggestions=None, chatllmTaskId=None, history={}, hostedArtifacts={}):
3336
super().__init__(client, deploymentConversationId)
3437
self.deployment_conversation_id = deploymentConversationId
3538
self.name = name
3639
self.deployment_id = deploymentId
40+
self.owner_user_id = ownerUserId
3741
self.created_at = createdAt
3842
self.last_event_created_at = lastEventCreatedAt
3943
self.has_history = hasHistory
@@ -51,11 +55,13 @@ def __init__(self, client, deploymentConversationId=None, name=None, deploymentI
5155
self.chatllm_task_id = chatllmTaskId
5256
self.history = client._build_class(
5357
DeploymentConversationEvent, history)
58+
self.hosted_artifacts = client._build_class(
59+
HostedArtifact, hostedArtifacts)
5460
self.deprecated_keys = {}
5561

5662
def __repr__(self):
57-
repr_dict = {f'deployment_conversation_id': repr(self.deployment_conversation_id), f'name': repr(self.name), f'deployment_id': repr(self.deployment_id), f'created_at': repr(self.created_at), f'last_event_created_at': repr(self.last_event_created_at), f'has_history': repr(self.has_history), f'external_session_id': repr(self.external_session_id), f'regenerate_attempt': repr(self.regenerate_attempt), f'external_application_id': repr(self.external_application_id), f'unused_document_upload_ids': repr(
58-
self.unused_document_upload_ids), f'humanize_instructions': repr(self.humanize_instructions), f'conversation_warning': repr(self.conversation_warning), f'conversation_type': repr(self.conversation_type), f'metadata': repr(self.metadata), f'llm_display_name': repr(self.llm_display_name), f'llm_bot_icon': repr(self.llm_bot_icon), f'search_suggestions': repr(self.search_suggestions), f'chatllm_task_id': repr(self.chatllm_task_id), f'history': repr(self.history)}
63+
repr_dict = {f'deployment_conversation_id': repr(self.deployment_conversation_id), f'name': repr(self.name), f'deployment_id': repr(self.deployment_id), f'owner_user_id': repr(self.owner_user_id), f'created_at': repr(self.created_at), f'last_event_created_at': repr(self.last_event_created_at), f'has_history': repr(self.has_history), f'external_session_id': repr(self.external_session_id), f'regenerate_attempt': repr(self.regenerate_attempt), f'external_application_id': repr(self.external_application_id), f'unused_document_upload_ids': repr(
64+
self.unused_document_upload_ids), f'humanize_instructions': repr(self.humanize_instructions), f'conversation_warning': repr(self.conversation_warning), f'conversation_type': repr(self.conversation_type), f'metadata': repr(self.metadata), f'llm_display_name': repr(self.llm_display_name), f'llm_bot_icon': repr(self.llm_bot_icon), f'search_suggestions': repr(self.search_suggestions), f'chatllm_task_id': repr(self.chatllm_task_id), f'history': repr(self.history), f'hosted_artifacts': repr(self.hosted_artifacts)}
5965
class_name = "DeploymentConversation"
6066
repr_str = ',\n '.join([f'{key}={value}' for key, value in repr_dict.items(
6167
) if getattr(self, key, None) is not None and key not in self.deprecated_keys])
@@ -68,8 +74,8 @@ def to_dict(self):
6874
Returns:
6975
dict: The dict value representation of the class parameters
7076
"""
71-
resp = {'deployment_conversation_id': self.deployment_conversation_id, 'name': self.name, 'deployment_id': self.deployment_id, 'created_at': self.created_at, 'last_event_created_at': self.last_event_created_at, 'has_history': self.has_history, 'external_session_id': self.external_session_id, 'regenerate_attempt': self.regenerate_attempt, 'external_application_id': self.external_application_id, 'unused_document_upload_ids':
72-
self.unused_document_upload_ids, 'humanize_instructions': self.humanize_instructions, 'conversation_warning': self.conversation_warning, 'conversation_type': self.conversation_type, 'metadata': self.metadata, 'llm_display_name': self.llm_display_name, 'llm_bot_icon': self.llm_bot_icon, 'search_suggestions': self.search_suggestions, 'chatllm_task_id': self.chatllm_task_id, 'history': self._get_attribute_as_dict(self.history)}
77+
resp = {'deployment_conversation_id': self.deployment_conversation_id, 'name': self.name, 'deployment_id': self.deployment_id, 'owner_user_id': self.owner_user_id, 'created_at': self.created_at, 'last_event_created_at': self.last_event_created_at, 'has_history': self.has_history, 'external_session_id': self.external_session_id, 'regenerate_attempt': self.regenerate_attempt, 'external_application_id': self.external_application_id, 'unused_document_upload_ids': self.unused_document_upload_ids,
78+
'humanize_instructions': self.humanize_instructions, 'conversation_warning': self.conversation_warning, 'conversation_type': self.conversation_type, 'metadata': self.metadata, 'llm_display_name': self.llm_display_name, 'llm_bot_icon': self.llm_bot_icon, 'search_suggestions': self.search_suggestions, 'chatllm_task_id': self.chatllm_task_id, 'history': self._get_attribute_as_dict(self.history), 'hosted_artifacts': self._get_attribute_as_dict(self.hosted_artifacts)}
7379
return {key: value for key, value in resp.items() if value is not None and key not in self.deprecated_keys}
7480

7581
def get(self, external_session_id: str = None, deployment_id: str = None, filter_intermediate_conversation_events: bool = True, get_unused_document_uploads: bool = False):

0 commit comments

Comments
 (0)