Skip to content

Commit f1f258b

Browse files
committed
Version 1.4.74
1 parent 69ecb55 commit f1f258b

File tree

341 files changed

+1645
-426
lines changed

Some content is hidden

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

341 files changed

+1645
-426
lines changed

abacusai/__init__.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@
6060
from .custom_metric import CustomMetric
6161
from .custom_metric_version import CustomMetricVersion
6262
from .custom_train_function_info import CustomTrainFunctionInfo
63+
from .daemon_task_conversation import DaemonTaskConversation
6364
from .data_consistency_duplication import DataConsistencyDuplication
6465
from .data_metrics import DataMetrics
6566
from .data_prep_logs import DataPrepLogs
@@ -290,4 +291,4 @@
290291
from .workflow_node_template import WorkflowNodeTemplate
291292

292293

293-
__version__ = "1.4.73"
294+
__version__ = "1.4.74"

abacusai/api_class/ai_agents.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -743,13 +743,12 @@ def __init__(self, name: str, chatbot_deployment_id: str = None, chatbot_paramet
743743
output_mappings = [WorkflowNodeOutputMapping(name='chat_output', variable_type=enums.WorkflowNodeOutputType.DICT, description='The output of the chatbot')]
744744

745745
# Determine function_name and create minimal source_code for parent validation
746-
function_name = None
747-
if chatbot_deployment_id:
748-
function_name = self.get_function_name()
749-
minimal_source_code = f"def {function_name or 'llm_agent_node'}(user_input):\n pass"
746+
# Always use get_function_name() which includes uid to ensure uniqueness
747+
function_name = self.get_function_name()
748+
minimal_source_code = f'def {function_name}(user_input):\n pass'
750749

751750
# Initialize parent class with minimal source code to satisfy validation
752-
super().__init__(name=name, function_name=function_name or 'llm_agent_node', source_code=minimal_source_code, input_mappings=input_mappings, output_mappings=output_mappings, input_schema=input_schema or WorkflowNodeInputSchema.from_input_mappings(input_mappings), output_schema=output_schema or WorkflowNodeOutputSchema.from_fields_list(['chat_output']))
751+
super().__init__(name=name, function_name=function_name, source_code=minimal_source_code, input_mappings=input_mappings, output_mappings=output_mappings, input_schema=input_schema or WorkflowNodeInputSchema.from_input_mappings(input_mappings), output_schema=output_schema or WorkflowNodeOutputSchema.from_fields_list(['chat_output']))
753752
self.node_type = 'llm_agent_node'
754753
self.source_code = None
755754

abacusai/api_class/enums.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -827,6 +827,7 @@ class DeploymentConversationType(ApiEnum):
827827
TEST_AGENT = 'TEST_AGENT'
828828
SUPER_AGENT = 'SUPER_AGENT'
829829
CODE_LLM_NON_INTERACTIVE = 'CODE_LLM_NON_INTERACTIVE'
830+
BROWSER_EXTENSION = 'BROWSER_EXTENSION'
830831

831832

832833
class AgentClientType(ApiEnum):

abacusai/api_class/segments.py

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import dataclasses
22
import uuid
3+
import warnings
34
from typing import Any, List
45

56
from . import enums
@@ -81,9 +82,21 @@ class TextResponseSection(ResponseSection):
8182

8283
segment: str
8384

84-
def __init__(self, text: str, section_key: str = None):
85+
def __init__(self, segment: str = None, section_key: str = None, text: str = None): # text is added for backward compatibility
86+
if segment is not None and text is not None:
87+
raise ValueError("Cannot specify both 'segment' and 'text' parameters. The 'text' parameter is deprecated, please use 'segment' only.")
88+
if segment is None and text is None:
89+
raise TypeError("'Segment' parameter is required.")
90+
91+
if text is not None:
92+
warnings.warn(
93+
"The 'text' parameter is deprecated and will be removed in future. Please use 'segment' instead.",
94+
DeprecationWarning,
95+
stacklevel=2
96+
)
97+
8598
super().__init__(type=enums.ResponseSectionType.TEXT, id=section_key)
86-
self.segment = text
99+
self.segment = segment if segment is not None else text
87100

88101

89102
@dataclasses.dataclass

abacusai/batch_prediction.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ def __init__(self, client, batchPredictionId=None, createdAt=None, name=None, de
8484
BatchPredictionArgs, globalPredictionArgs)
8585
self.batch_prediction_args = client._build_class(getattr(
8686
api_class, batchPredictionArgsType, BatchPredictionArgs) if batchPredictionArgsType else BatchPredictionArgs, batchPredictionArgs)
87-
self.deprecated_keys = {'explanations', 'global_prediction_args'}
87+
self.deprecated_keys = {'global_prediction_args', 'explanations'}
8888

8989
def __repr__(self):
9090
repr_dict = {f'batch_prediction_id': repr(self.batch_prediction_id), f'created_at': repr(self.created_at), f'name': repr(self.name), f'deployment_id': repr(self.deployment_id), f'file_connector_output_location': repr(self.file_connector_output_location), f'database_connector_id': repr(self.database_connector_id), f'database_output_configuration': repr(self.database_output_configuration), f'file_output_format': repr(self.file_output_format), f'connector_type': repr(self.connector_type), f'legacy_input_location': repr(self.legacy_input_location), f'output_feature_group_id': repr(self.output_feature_group_id), f'feature_group_table_name': repr(self.feature_group_table_name), f'output_feature_group_table_name': repr(self.output_feature_group_table_name), f'summary_feature_group_table_name': repr(self.summary_feature_group_table_name), f'csv_input_prefix': repr(

abacusai/batch_prediction_version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ def __init__(self, client, batchPredictionVersion=None, batchPredictionId=None,
100100
BatchPredictionArgs, globalPredictionArgs)
101101
self.batch_prediction_args = client._build_class(getattr(
102102
api_class, batchPredictionArgsType, BatchPredictionArgs) if batchPredictionArgsType else BatchPredictionArgs, batchPredictionArgs)
103-
self.deprecated_keys = {'explanations', 'global_prediction_args'}
103+
self.deprecated_keys = {'global_prediction_args', 'explanations'}
104104

105105
def __repr__(self):
106106
repr_dict = {f'batch_prediction_version': repr(self.batch_prediction_version), f'batch_prediction_id': repr(self.batch_prediction_id), f'status': repr(self.status), f'drift_monitor_status': repr(self.drift_monitor_status), f'deployment_id': repr(self.deployment_id), f'model_id': repr(self.model_id), f'model_version': repr(self.model_version), f'predictions_started_at': repr(self.predictions_started_at), f'predictions_completed_at': repr(self.predictions_completed_at), f'database_output_error': repr(self.database_output_error), f'total_predictions': repr(self.total_predictions), f'failed_predictions': repr(self.failed_predictions), f'database_connector_id': repr(self.database_connector_id), f'database_output_configuration': repr(self.database_output_configuration), f'file_connector_output_location': repr(self.file_connector_output_location), f'file_output_format': repr(self.file_output_format), f'connector_type': repr(self.connector_type), f'legacy_input_location': repr(self.legacy_input_location), f'error': repr(self.error), f'drift_monitor_error': repr(self.drift_monitor_error), f'monitor_warnings': repr(self.monitor_warnings), f'csv_input_prefix': repr(

abacusai/chatllm_task.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,10 @@ class ChatllmTask(AbstractApiClass):
2222
numUnreadTaskInstances (int): The number of unread task instances for the chatllm task.
2323
computePointsUsed (int): The compute points used for the chatllm task.
2424
displayMarkdown (str): The display markdown for the chatllm task.
25+
requiresNewConversation (bool): Whether a new conversation is required for the chatllm task.
2526
"""
2627

27-
def __init__(self, client, chatllmTaskId=None, daemonTaskId=None, taskType=None, name=None, instructions=None, lifecycle=None, scheduleInfo=None, externalApplicationId=None, deploymentConversationId=None, sourceDeploymentConversationId=None, enableEmailAlerts=None, email=None, numUnreadTaskInstances=None, computePointsUsed=None, displayMarkdown=None):
28+
def __init__(self, client, chatllmTaskId=None, daemonTaskId=None, taskType=None, name=None, instructions=None, lifecycle=None, scheduleInfo=None, externalApplicationId=None, deploymentConversationId=None, sourceDeploymentConversationId=None, enableEmailAlerts=None, email=None, numUnreadTaskInstances=None, computePointsUsed=None, displayMarkdown=None, requiresNewConversation=None):
2829
super().__init__(client, chatllmTaskId)
2930
self.chatllm_task_id = chatllmTaskId
3031
self.daemon_task_id = daemonTaskId
@@ -41,11 +42,12 @@ def __init__(self, client, chatllmTaskId=None, daemonTaskId=None, taskType=None,
4142
self.num_unread_task_instances = numUnreadTaskInstances
4243
self.compute_points_used = computePointsUsed
4344
self.display_markdown = displayMarkdown
45+
self.requires_new_conversation = requiresNewConversation
4446
self.deprecated_keys = {}
4547

4648
def __repr__(self):
4749
repr_dict = {f'chatllm_task_id': repr(self.chatllm_task_id), f'daemon_task_id': repr(self.daemon_task_id), f'task_type': repr(self.task_type), 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(
48-
self.deployment_conversation_id), f'source_deployment_conversation_id': repr(self.source_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), f'display_markdown': repr(self.display_markdown)}
50+
self.deployment_conversation_id), f'source_deployment_conversation_id': repr(self.source_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), f'display_markdown': repr(self.display_markdown), f'requires_new_conversation': repr(self.requires_new_conversation)}
4951
class_name = "ChatllmTask"
5052
repr_str = ',\n '.join([f'{key}={value}' for key, value in repr_dict.items(
5153
) if getattr(self, key, None) is not None and key not in self.deprecated_keys])
@@ -58,6 +60,6 @@ def to_dict(self):
5860
Returns:
5961
dict: The dict value representation of the class parameters
6062
"""
61-
resp = {'chatllm_task_id': self.chatllm_task_id, 'daemon_task_id': self.daemon_task_id, 'task_type': self.task_type, 'name': self.name, 'instructions': self.instructions, 'lifecycle': self.lifecycle, 'schedule_info': self.schedule_info, 'external_application_id': self.external_application_id, 'deployment_conversation_id':
62-
self.deployment_conversation_id, 'source_deployment_conversation_id': self.source_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, 'display_markdown': self.display_markdown}
63+
resp = {'chatllm_task_id': self.chatllm_task_id, 'daemon_task_id': self.daemon_task_id, 'task_type': self.task_type, 'name': self.name, 'instructions': self.instructions, 'lifecycle': self.lifecycle, 'schedule_info': self.schedule_info, 'external_application_id': self.external_application_id, 'deployment_conversation_id': self.deployment_conversation_id,
64+
'source_deployment_conversation_id': self.source_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, 'display_markdown': self.display_markdown, 'requires_new_conversation': self.requires_new_conversation}
6365
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: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -667,7 +667,7 @@ class BaseApiClient:
667667
client_options (ClientOptions): Optional API client configurations
668668
skip_version_check (bool): If true, will skip checking the server's current API version on initializing the client
669669
"""
670-
client_version = '1.4.73'
670+
client_version = '1.4.74'
671671

672672
def __init__(self, api_key: str = None, server: str = None, client_options: ClientOptions = None, skip_version_check: bool = False, include_tb: bool = False):
673673
self.api_key = api_key
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 DaemonTaskConversation(AbstractApiClass):
5+
"""
6+
Daemon Task Conversation
7+
8+
Args:
9+
client (ApiClient): An authenticated API Client instance
10+
deploymentConversationId (id): The ID of the deployment conversation
11+
createdAt (str): The creation timestamp
12+
updatedAt (str): The last update timestamp
13+
deploymentConversationName (str): The name of the conversation
14+
externalApplicationId (str): The external application ID
15+
"""
16+
17+
def __init__(self, client, deploymentConversationId=None, createdAt=None, updatedAt=None, deploymentConversationName=None, externalApplicationId=None):
18+
super().__init__(client, None)
19+
self.deployment_conversation_id = deploymentConversationId
20+
self.created_at = createdAt
21+
self.updated_at = updatedAt
22+
self.deployment_conversation_name = deploymentConversationName
23+
self.external_application_id = externalApplicationId
24+
self.deprecated_keys = {}
25+
26+
def __repr__(self):
27+
repr_dict = {f'deployment_conversation_id': repr(self.deployment_conversation_id), f'created_at': repr(self.created_at), f'updated_at': repr(
28+
self.updated_at), f'deployment_conversation_name': repr(self.deployment_conversation_name), f'external_application_id': repr(self.external_application_id)}
29+
class_name = "DaemonTaskConversation"
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 = {'deployment_conversation_id': self.deployment_conversation_id, 'created_at': self.created_at, 'updated_at': self.updated_at,
42+
'deployment_conversation_name': self.deployment_conversation_name, 'external_application_id': self.external_application_id}
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)