Skip to content

Commit

Permalink
Version 1.4.14
Browse files Browse the repository at this point in the history
  • Loading branch information
harshit-jain-git committed Oct 11, 2024
1 parent a54cec1 commit cfde11e
Show file tree
Hide file tree
Showing 304 changed files with 17,134 additions and 15,999 deletions.
3 changes: 2 additions & 1 deletion abacusai/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
from .chatllm_referral_invite import ChatllmReferralInvite
from .client import AgentResponse, ApiClient, ApiException, ClientOptions, ReadOnlyClient, _request_context
from .code_source import CodeSource
from .compute_point_info import ComputePointInfo
from .concatenation_config import ConcatenationConfig
from .cpu_gpu_memory_specs import CpuGpuMemorySpecs
from .custom_chat_instructions import CustomChatInstructions
Expand Down Expand Up @@ -217,4 +218,4 @@
from .workflow_node_template import WorkflowNodeTemplate


__version__ = "1.4.13"
__version__ = "1.4.14"
1 change: 1 addition & 0 deletions abacusai/api_class/ai_agents.py
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,7 @@ def __init__(self, name: str, input_mappings: Union[Dict[str, WorkflowNodeInputM
else:
self._user_args = locals()
if function:
self.function = function
self.function_name = function.__name__
self.source_code = get_clean_function_source_code_for_agent(function)
elif function_name and source_code:
Expand Down
2 changes: 2 additions & 0 deletions abacusai/api_class/dataset_application_connector.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,11 @@ class ApplicationConnectorDatasetConfig(DatasetConfig):
Args:
application_connector_type (enums.ApplicationConnectorType): The type of application connector
application_connector_id (str): The ID of the application connector
document_processing_config (DatasetDocumentProcessingConfig): The document processing configuration. Only valid if is_documentset is True for the dataset.
"""
application_connector_type: enums.ApplicationConnectorType = dataclasses.field(default=None, repr=False, init=False)
application_connector_id: str = dataclasses.field(default=None)
document_processing_config: DatasetDocumentProcessingConfig = dataclasses.field(default=None)

@classmethod
Expand Down
2 changes: 2 additions & 0 deletions abacusai/api_class/enums.py
Original file line number Diff line number Diff line change
Expand Up @@ -410,6 +410,8 @@ class ApplicationConnectorType(ApiEnum):
ONEDRIVEUSER = 'ONEDRIVEUSER'
JIRAAUTH = 'JIRAAUTH'
TEAMSSCRAPER = 'TEAMSSCRAPER'
GITHUBUSER = 'GITHUBUSER'
OKTASAML = 'OKTASAML'


class StreamingConnectorType(ApiEnum):
Expand Down
10 changes: 5 additions & 5 deletions abacusai/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -608,7 +608,7 @@ class BaseApiClient:
client_options (ClientOptions): Optional API client configurations
skip_version_check (bool): If true, will skip checking the server's current API version on initializing the client
"""
client_version = '1.4.13'
client_version = '1.4.14'

def __init__(self, api_key: str = None, server: str = None, client_options: ClientOptions = None, skip_version_check: bool = False, include_tb: bool = False):
self.api_key = api_key
Expand Down Expand Up @@ -8502,7 +8502,7 @@ def delete_external_application(self, external_application_id: str):
external_application_id (str): The ID of the External Application."""
return self._call_api('deleteExternalApplication', 'DELETE', query_params={'externalApplicationId': external_application_id})

def create_agent(self, project_id: str, function_source_code: str = None, agent_function_name: str = None, name: str = None, memory: int = None, package_requirements: list = [], description: str = None, enable_binary_input: bool = False, evaluation_feature_group_id: str = None, agent_input_schema: dict = None, agent_output_schema: dict = None, workflow_graph: Union[dict, WorkflowGraph] = None, agent_interface: Union[AgentInterface, str] = AgentInterface.DEFAULT, included_modules: List = None, agent_connectors: dict = None, initialize_function_name: str = None, initialize_function_code: str = None) -> Agent:
def create_agent(self, project_id: str, function_source_code: str = None, agent_function_name: str = None, name: str = None, memory: int = None, package_requirements: list = [], description: str = None, enable_binary_input: bool = False, evaluation_feature_group_id: str = None, agent_input_schema: dict = None, agent_output_schema: dict = None, workflow_graph: Union[dict, WorkflowGraph] = None, agent_interface: Union[AgentInterface, str] = AgentInterface.DEFAULT, included_modules: List = None, agent_connectors: Dict = None, initialize_function_name: str = None, initialize_function_code: str = None) -> Agent:
"""Creates a new AI agent using the given agent workflow graph definition.

Args:
Expand All @@ -8515,15 +8515,15 @@ def create_agent(self, project_id: str, function_source_code: str = None, agent_
workflow_graph (WorkflowGraph): The workflow graph for the agent.
agent_interface (AgentInterface): The interface that the agent will be deployed with.
included_modules (List): A list of user created custom modules to include in the agent's environment.
agent_connectors (dict): A dictionary of application connectors that are required for the agent mapped with oauth list for them.
agent_connectors (Dict): A dictionary mapping ApplicationConnectorType keys to lists of OAuth scopes. Each key represents a specific application connector, while the value is a list of scopes that define the permissions granted to the application.
initialize_function_name (str): The name of the function to be used for initialization.
initialize_function_code (str): The function code to be used for initialization.

Returns:
Agent: The new agent."""
return self._call_api('createAgent', 'POST', query_params={}, body={'projectId': project_id, 'functionSourceCode': function_source_code, 'agentFunctionName': agent_function_name, 'name': name, 'memory': memory, 'packageRequirements': package_requirements, 'description': description, 'enableBinaryInput': enable_binary_input, 'evaluationFeatureGroupId': evaluation_feature_group_id, 'agentInputSchema': agent_input_schema, 'agentOutputSchema': agent_output_schema, 'workflowGraph': workflow_graph, 'agentInterface': agent_interface, 'includedModules': included_modules, 'agentConnectors': agent_connectors, 'initializeFunctionName': initialize_function_name, 'initializeFunctionCode': initialize_function_code}, parse_type=Agent)

def update_agent(self, model_id: str, function_source_code: str = None, agent_function_name: str = None, memory: int = None, package_requirements: list = None, description: str = None, enable_binary_input: bool = None, agent_input_schema: dict = None, agent_output_schema: dict = None, workflow_graph: Union[dict, WorkflowGraph] = None, agent_interface: Union[AgentInterface, str] = None, included_modules: List = None, agent_connectors: dict = None, initialize_function_name: str = None, initialize_function_code: str = None) -> Agent:
def update_agent(self, model_id: str, function_source_code: str = None, agent_function_name: str = None, memory: int = None, package_requirements: list = None, description: str = None, enable_binary_input: bool = None, agent_input_schema: dict = None, agent_output_schema: dict = None, workflow_graph: Union[dict, WorkflowGraph] = None, agent_interface: Union[AgentInterface, str] = None, included_modules: List = None, agent_connectors: Dict = None, initialize_function_name: str = None, initialize_function_code: str = None) -> Agent:
"""Updates an existing AI Agent. A new version of the agent will be created and published.

Args:
Expand All @@ -8534,7 +8534,7 @@ def update_agent(self, model_id: str, function_source_code: str = None, agent_fu
workflow_graph (WorkflowGraph): The workflow graph for the agent.
agent_interface (AgentInterface): The interface that the agent will be deployed with.
included_modules (List): A list of user created custom modules to include in the agent's environment.
agent_connectors (dict): A dictionary of application connectors mapped with list of the oauth scopes required that are required for the agent.
agent_connectors (Dict): A dictionary mapping ApplicationConnectorType keys to lists of OAuth scopes. Each key represents a specific application connector, while the value is a list of scopes that define the permissions granted to the application.
initialize_function_name (str): The name of the function to be used for initialization.
initialize_function_code (str): The function code to be used for initialization.

Expand Down
45 changes: 45 additions & 0 deletions abacusai/compute_point_info.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
from .return_class import AbstractApiClass


class ComputePointInfo(AbstractApiClass):
"""
The compute point info of the organization
Args:
client (ApiClient): An authenticated API Client instance
updatedAt (str): The last time the compute point info was updated
last24HoursUsage (int): The 24 hours usage of the organization
last7DaysUsage (int): The 7 days usage of the organization
currMonthAvailPoints (int): The current month's available compute points
currMonthUsage (int): The current month's usage compute points
lastThrottlePopUp (str): The last time the organization was throttled
"""

def __init__(self, client, updatedAt=None, last24HoursUsage=None, last7DaysUsage=None, currMonthAvailPoints=None, currMonthUsage=None, lastThrottlePopUp=None):
super().__init__(client, None)
self.updated_at = updatedAt
self.last_24_hours_usage = last24HoursUsage
self.last_7_days_usage = last7DaysUsage
self.curr_month_avail_points = currMonthAvailPoints
self.curr_month_usage = currMonthUsage
self.last_throttle_pop_up = lastThrottlePopUp
self.deprecated_keys = {}

def __repr__(self):
repr_dict = {f'updated_at': repr(self.updated_at), f'last_24_hours_usage': repr(self.last_24_hours_usage), f'last_7_days_usage': repr(self.last_7_days_usage), f'curr_month_avail_points': repr(
self.curr_month_avail_points), f'curr_month_usage': repr(self.curr_month_usage), f'last_throttle_pop_up': repr(self.last_throttle_pop_up)}
class_name = "ComputePointInfo"
repr_str = ',\n '.join([f'{key}={value}' for key, value in repr_dict.items(
) if getattr(self, key, None) is not None and key not in self.deprecated_keys])
return f"{class_name}({repr_str})"

def to_dict(self):
"""
Get a dict representation of the parameters in this class
Returns:
dict: The dict value representation of the class parameters
"""
resp = {'updated_at': self.updated_at, 'last_24_hours_usage': self.last_24_hours_usage, 'last_7_days_usage': self.last_7_days_usage,
'curr_month_avail_points': self.curr_month_avail_points, 'curr_month_usage': self.curr_month_usage, 'last_throttle_pop_up': self.last_throttle_pop_up}
return {key: value for key, value in resp.items() if value is not None and key not in self.deprecated_keys}
6 changes: 3 additions & 3 deletions abacusai/model.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from typing import List, Union
from typing import Dict, List, Union

from . import api_class
from .api_class import AgentInterface, TrainingConfig, WorkflowGraph
Expand Down Expand Up @@ -355,7 +355,7 @@ def get_training_types_for_deployment(self, model_version: str = None, algorithm
"""
return self.client.get_model_training_types_for_deployment(self.model_id, model_version, algorithm)

def update_agent(self, function_source_code: str = None, agent_function_name: str = None, memory: int = None, package_requirements: list = None, description: str = None, enable_binary_input: bool = None, agent_input_schema: dict = None, agent_output_schema: dict = None, workflow_graph: Union[dict, WorkflowGraph] = None, agent_interface: Union[dict, AgentInterface] = None, included_modules: List = None, agent_connectors: dict = None, initialize_function_name: str = None, initialize_function_code: str = None):
def update_agent(self, function_source_code: str = None, agent_function_name: str = None, memory: int = None, package_requirements: list = None, description: str = None, enable_binary_input: bool = None, agent_input_schema: dict = None, agent_output_schema: dict = None, workflow_graph: Union[dict, WorkflowGraph] = None, agent_interface: Union[dict, AgentInterface] = None, included_modules: List = None, agent_connectors: Dict = None, initialize_function_name: str = None, initialize_function_code: str = None):
"""
Updates an existing AI Agent. A new version of the agent will be created and published.
Expand All @@ -366,7 +366,7 @@ def update_agent(self, function_source_code: str = None, agent_function_name: st
workflow_graph (WorkflowGraph): The workflow graph for the agent.
agent_interface (AgentInterface): The interface that the agent will be deployed with.
included_modules (List): A list of user created custom modules to include in the agent's environment.
agent_connectors (dict): A dictionary of application connectors mapped with list of the oauth scopes required that are required for the agent.
agent_connectors (Dict): A dictionary mapping ApplicationConnectorType keys to lists of OAuth scopes. Each key represents a specific application connector, while the value is a list of scopes that define the permissions granted to the application.
initialize_function_name (str): The name of the function to be used for initialization.
initialize_function_code (str): The function code to be used for initialization.
Expand Down
8 changes: 5 additions & 3 deletions abacusai/module.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,20 +11,22 @@ class Module(AbstractApiClass):
name (str): The name to identify the algorithm. Only uppercase letters, numbers, and underscores are allowed.
createdAt (str): The date and time when the Python function was created, in ISO-8601 format.
notebookId (str): The unique string identifier of the notebook used to create or edit the module.
hideModuleCode (bool): Whether the module code is hidden from external users
codeSource (CodeSource): Information about the source code of the Python function.
"""

def __init__(self, client, name=None, createdAt=None, notebookId=None, codeSource={}):
def __init__(self, client, name=None, createdAt=None, notebookId=None, hideModuleCode=None, codeSource={}):
super().__init__(client, None)
self.name = name
self.created_at = createdAt
self.notebook_id = notebookId
self.hide_module_code = hideModuleCode
self.code_source = client._build_class(CodeSource, codeSource)
self.deprecated_keys = {}

def __repr__(self):
repr_dict = {f'name': repr(self.name), f'created_at': repr(self.created_at), f'notebook_id': repr(
self.notebook_id), f'code_source': repr(self.code_source)}
self.notebook_id), f'hide_module_code': repr(self.hide_module_code), f'code_source': repr(self.code_source)}
class_name = "Module"
repr_str = ',\n '.join([f'{key}={value}' for key, value in repr_dict.items(
) if getattr(self, key, None) is not None and key not in self.deprecated_keys])
Expand All @@ -38,5 +40,5 @@ def to_dict(self):
dict: The dict value representation of the class parameters
"""
resp = {'name': self.name, 'created_at': self.created_at, 'notebook_id': self.notebook_id,
'code_source': self._get_attribute_as_dict(self.code_source)}
'hide_module_code': self.hide_module_code, 'code_source': self._get_attribute_as_dict(self.code_source)}
return {key: value for key, value in resp.items() if value is not None and key not in self.deprecated_keys}
6 changes: 3 additions & 3 deletions abacusai/project.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from typing import List, Union
from typing import Dict, List, Union

from .api_class import (
AgentInterface, AlertActionConfig, AlertConditionConfig,
Expand Down Expand Up @@ -609,7 +609,7 @@ def create_chat_session(self, name: str = None):
"""
return self.client.create_chat_session(self.project_id, name)

def create_agent(self, function_source_code: str = None, agent_function_name: str = None, name: str = None, memory: int = None, package_requirements: list = [], description: str = None, enable_binary_input: bool = False, evaluation_feature_group_id: str = None, agent_input_schema: dict = None, agent_output_schema: dict = None, workflow_graph: Union[dict, WorkflowGraph] = None, agent_interface: Union[dict, AgentInterface] = AgentInterface.DEFAULT, included_modules: List = None, agent_connectors: dict = None, initialize_function_name: str = None, initialize_function_code: str = None):
def create_agent(self, function_source_code: str = None, agent_function_name: str = None, name: str = None, memory: int = None, package_requirements: list = [], description: str = None, enable_binary_input: bool = False, evaluation_feature_group_id: str = None, agent_input_schema: dict = None, agent_output_schema: dict = None, workflow_graph: Union[dict, WorkflowGraph] = None, agent_interface: Union[dict, AgentInterface] = AgentInterface.DEFAULT, included_modules: List = None, agent_connectors: Dict = None, initialize_function_name: str = None, initialize_function_code: str = None):
"""
Creates a new AI agent using the given agent workflow graph definition.
Expand All @@ -622,7 +622,7 @@ def create_agent(self, function_source_code: str = None, agent_function_name: st
workflow_graph (WorkflowGraph): The workflow graph for the agent.
agent_interface (AgentInterface): The interface that the agent will be deployed with.
included_modules (List): A list of user created custom modules to include in the agent's environment.
agent_connectors (dict): A dictionary of application connectors that are required for the agent mapped with oauth list for them.
agent_connectors (Dict): A dictionary mapping ApplicationConnectorType keys to lists of OAuth scopes. Each key represents a specific application connector, while the value is a list of scopes that define the permissions granted to the application.
initialize_function_name (str): The name of the function to be used for initialization.
initialize_function_code (str): The function code to be used for initialization.
Expand Down
Loading

0 comments on commit cfde11e

Please sign in to comment.