@@ -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