@@ -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
0 commit comments