dataiku-api-client 14.7.2__tar.gz → 14.7.3__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (137) hide show
  1. {dataiku_api_client-14.7.2 → dataiku_api_client-14.7.3}/HISTORY.txt +5 -0
  2. {dataiku_api_client-14.7.2/dataiku_api_client.egg-info → dataiku_api_client-14.7.3}/PKG-INFO +7 -2
  3. {dataiku_api_client-14.7.2 → dataiku_api_client-14.7.3/dataiku_api_client.egg-info}/PKG-INFO +7 -2
  4. {dataiku_api_client-14.7.2 → dataiku_api_client-14.7.3}/dataiku_api_client.egg-info/SOURCES.txt +1 -0
  5. {dataiku_api_client-14.7.2 → dataiku_api_client-14.7.3}/dataikuapi/dss/agent_tool.py +5 -2
  6. {dataiku_api_client-14.7.2 → dataiku_api_client-14.7.3}/dataikuapi/dss/langchain/embeddings.py +11 -2
  7. {dataiku_api_client-14.7.2 → dataiku_api_client-14.7.3}/dataikuapi/dss/llm.py +146 -12
  8. dataiku_api_client-14.7.3/dataikuapi/dss/mira.py +226 -0
  9. {dataiku_api_client-14.7.2 → dataiku_api_client-14.7.3}/dataikuapi/dssclient.py +12 -0
  10. {dataiku_api_client-14.7.2 → dataiku_api_client-14.7.3}/setup.py +1 -1
  11. {dataiku_api_client-14.7.2 → dataiku_api_client-14.7.3}/LICENSE.txt +0 -0
  12. {dataiku_api_client-14.7.2 → dataiku_api_client-14.7.3}/MANIFEST.in +0 -0
  13. {dataiku_api_client-14.7.2 → dataiku_api_client-14.7.3}/README +0 -0
  14. {dataiku_api_client-14.7.2 → dataiku_api_client-14.7.3}/dataiku_api_client.egg-info/dependency_links.txt +0 -0
  15. {dataiku_api_client-14.7.2 → dataiku_api_client-14.7.3}/dataiku_api_client.egg-info/requires.txt +0 -0
  16. {dataiku_api_client-14.7.2 → dataiku_api_client-14.7.3}/dataiku_api_client.egg-info/top_level.txt +0 -0
  17. {dataiku_api_client-14.7.2 → dataiku_api_client-14.7.3}/dataikuapi/__init__.py +0 -0
  18. {dataiku_api_client-14.7.2 → dataiku_api_client-14.7.3}/dataikuapi/apinode_admin/__init__.py +0 -0
  19. {dataiku_api_client-14.7.2 → dataiku_api_client-14.7.3}/dataikuapi/apinode_admin/auth.py +0 -0
  20. {dataiku_api_client-14.7.2 → dataiku_api_client-14.7.3}/dataikuapi/apinode_admin/service.py +0 -0
  21. {dataiku_api_client-14.7.2 → dataiku_api_client-14.7.3}/dataikuapi/apinode_admin_client.py +0 -0
  22. {dataiku_api_client-14.7.2 → dataiku_api_client-14.7.3}/dataikuapi/apinode_client.py +0 -0
  23. {dataiku_api_client-14.7.2 → dataiku_api_client-14.7.3}/dataikuapi/auth.py +0 -0
  24. {dataiku_api_client-14.7.2 → dataiku_api_client-14.7.3}/dataikuapi/base_client.py +0 -0
  25. {dataiku_api_client-14.7.2 → dataiku_api_client-14.7.3}/dataikuapi/dss/__init__.py +0 -0
  26. {dataiku_api_client-14.7.2 → dataiku_api_client-14.7.3}/dataikuapi/dss/admin.py +0 -0
  27. {dataiku_api_client-14.7.2 → dataiku_api_client-14.7.3}/dataikuapi/dss/agent.py +0 -0
  28. {dataiku_api_client-14.7.2 → dataiku_api_client-14.7.3}/dataikuapi/dss/agent_review.py +0 -0
  29. {dataiku_api_client-14.7.2 → dataiku_api_client-14.7.3}/dataikuapi/dss/analysis.py +0 -0
  30. {dataiku_api_client-14.7.2 → dataiku_api_client-14.7.3}/dataikuapi/dss/apideployer.py +0 -0
  31. {dataiku_api_client-14.7.2 → dataiku_api_client-14.7.3}/dataikuapi/dss/apiservice.py +0 -0
  32. {dataiku_api_client-14.7.2 → dataiku_api_client-14.7.3}/dataikuapi/dss/app.py +0 -0
  33. {dataiku_api_client-14.7.2 → dataiku_api_client-14.7.3}/dataikuapi/dss/businessapp.py +0 -0
  34. {dataiku_api_client-14.7.2 → dataiku_api_client-14.7.3}/dataikuapi/dss/cobuild.py +0 -0
  35. {dataiku_api_client-14.7.2 → dataiku_api_client-14.7.3}/dataikuapi/dss/codestudio.py +0 -0
  36. {dataiku_api_client-14.7.2 → dataiku_api_client-14.7.3}/dataikuapi/dss/continuousactivity.py +0 -0
  37. {dataiku_api_client-14.7.2 → dataiku_api_client-14.7.3}/dataikuapi/dss/dashboard.py +0 -0
  38. {dataiku_api_client-14.7.2 → dataiku_api_client-14.7.3}/dataikuapi/dss/data_collection.py +0 -0
  39. {dataiku_api_client-14.7.2 → dataiku_api_client-14.7.3}/dataikuapi/dss/data_directories_footprint.py +0 -0
  40. {dataiku_api_client-14.7.2 → dataiku_api_client-14.7.3}/dataikuapi/dss/data_quality.py +0 -0
  41. {dataiku_api_client-14.7.2 → dataiku_api_client-14.7.3}/dataikuapi/dss/dataset.py +0 -0
  42. {dataiku_api_client-14.7.2 → dataiku_api_client-14.7.3}/dataikuapi/dss/discussion.py +0 -0
  43. {dataiku_api_client-14.7.2 → dataiku_api_client-14.7.3}/dataikuapi/dss/document_extractor.py +0 -0
  44. {dataiku_api_client-14.7.2 → dataiku_api_client-14.7.3}/dataikuapi/dss/drift.py +0 -0
  45. {dataiku_api_client-14.7.2 → dataiku_api_client-14.7.3}/dataikuapi/dss/enterprise_asset_library.py +0 -0
  46. {dataiku_api_client-14.7.2 → dataiku_api_client-14.7.3}/dataikuapi/dss/evaluationcomparison.py +0 -0
  47. {dataiku_api_client-14.7.2 → dataiku_api_client-14.7.3}/dataikuapi/dss/evaluationstore.py +0 -0
  48. {dataiku_api_client-14.7.2 → dataiku_api_client-14.7.3}/dataikuapi/dss/feature_store.py +0 -0
  49. {dataiku_api_client-14.7.2 → dataiku_api_client-14.7.3}/dataikuapi/dss/flow.py +0 -0
  50. {dataiku_api_client-14.7.2 → dataiku_api_client-14.7.3}/dataikuapi/dss/future.py +0 -0
  51. {dataiku_api_client-14.7.2 → dataiku_api_client-14.7.3}/dataikuapi/dss/insight.py +0 -0
  52. {dataiku_api_client-14.7.2 → dataiku_api_client-14.7.3}/dataikuapi/dss/job.py +0 -0
  53. {dataiku_api_client-14.7.2 → dataiku_api_client-14.7.3}/dataikuapi/dss/jupyternotebook.py +0 -0
  54. {dataiku_api_client-14.7.2 → dataiku_api_client-14.7.3}/dataikuapi/dss/knowledgebank.py +0 -0
  55. {dataiku_api_client-14.7.2 → dataiku_api_client-14.7.3}/dataikuapi/dss/labeling_task.py +0 -0
  56. {dataiku_api_client-14.7.2 → dataiku_api_client-14.7.3}/dataikuapi/dss/langchain/__init__.py +0 -0
  57. {dataiku_api_client-14.7.2 → dataiku_api_client-14.7.3}/dataikuapi/dss/langchain/knowledge_bank.py +0 -0
  58. {dataiku_api_client-14.7.2 → dataiku_api_client-14.7.3}/dataikuapi/dss/langchain/llm.py +0 -0
  59. {dataiku_api_client-14.7.2 → dataiku_api_client-14.7.3}/dataikuapi/dss/langchain/tool.py +0 -0
  60. {dataiku_api_client-14.7.2 → dataiku_api_client-14.7.3}/dataikuapi/dss/langchain/utils.py +0 -0
  61. {dataiku_api_client-14.7.2 → dataiku_api_client-14.7.3}/dataikuapi/dss/llm_tracing/__init__.py +0 -0
  62. {dataiku_api_client-14.7.2 → dataiku_api_client-14.7.3}/dataikuapi/dss/llm_utils/__init__.py +0 -0
  63. {dataiku_api_client-14.7.2 → dataiku_api_client-14.7.3}/dataikuapi/dss/local_model.py +0 -0
  64. {dataiku_api_client-14.7.2 → dataiku_api_client-14.7.3}/dataikuapi/dss/macro.py +0 -0
  65. {dataiku_api_client-14.7.2 → dataiku_api_client-14.7.3}/dataikuapi/dss/managedfolder.py +0 -0
  66. {dataiku_api_client-14.7.2 → dataiku_api_client-14.7.3}/dataikuapi/dss/meaning.py +0 -0
  67. {dataiku_api_client-14.7.2 → dataiku_api_client-14.7.3}/dataikuapi/dss/messaging_channel.py +0 -0
  68. {dataiku_api_client-14.7.2 → dataiku_api_client-14.7.3}/dataikuapi/dss/metrics.py +0 -0
  69. {dataiku_api_client-14.7.2 → dataiku_api_client-14.7.3}/dataikuapi/dss/ml.py +0 -0
  70. {dataiku_api_client-14.7.2 → dataiku_api_client-14.7.3}/dataikuapi/dss/mlflow.py +0 -0
  71. {dataiku_api_client-14.7.2 → dataiku_api_client-14.7.3}/dataikuapi/dss/modelcomparison.py +0 -0
  72. {dataiku_api_client-14.7.2 → dataiku_api_client-14.7.3}/dataikuapi/dss/modelevaluationstore.py +0 -0
  73. {dataiku_api_client-14.7.2 → dataiku_api_client-14.7.3}/dataikuapi/dss/notebook.py +0 -0
  74. {dataiku_api_client-14.7.2 → dataiku_api_client-14.7.3}/dataikuapi/dss/plugin.py +0 -0
  75. {dataiku_api_client-14.7.2 → dataiku_api_client-14.7.3}/dataikuapi/dss/project.py +0 -0
  76. {dataiku_api_client-14.7.2 → dataiku_api_client-14.7.3}/dataikuapi/dss/project_standards.py +0 -0
  77. {dataiku_api_client-14.7.2 → dataiku_api_client-14.7.3}/dataikuapi/dss/projectdeployer.py +0 -0
  78. {dataiku_api_client-14.7.2 → dataiku_api_client-14.7.3}/dataikuapi/dss/projectfolder.py +0 -0
  79. {dataiku_api_client-14.7.2 → dataiku_api_client-14.7.3}/dataikuapi/dss/projectlibrary.py +0 -0
  80. {dataiku_api_client-14.7.2 → dataiku_api_client-14.7.3}/dataikuapi/dss/recipe.py +0 -0
  81. {dataiku_api_client-14.7.2 → dataiku_api_client-14.7.3}/dataikuapi/dss/retrieval_augmented_llm.py +0 -0
  82. {dataiku_api_client-14.7.2 → dataiku_api_client-14.7.3}/dataikuapi/dss/savedmodel.py +0 -0
  83. {dataiku_api_client-14.7.2 → dataiku_api_client-14.7.3}/dataikuapi/dss/scenario.py +0 -0
  84. {dataiku_api_client-14.7.2 → dataiku_api_client-14.7.3}/dataikuapi/dss/semantic_model.py +0 -0
  85. {dataiku_api_client-14.7.2 → dataiku_api_client-14.7.3}/dataikuapi/dss/sqlnotebook.py +0 -0
  86. {dataiku_api_client-14.7.2 → dataiku_api_client-14.7.3}/dataikuapi/dss/sqlquery.py +0 -0
  87. {dataiku_api_client-14.7.2 → dataiku_api_client-14.7.3}/dataikuapi/dss/statistics.py +0 -0
  88. {dataiku_api_client-14.7.2 → dataiku_api_client-14.7.3}/dataikuapi/dss/streaming_endpoint.py +0 -0
  89. {dataiku_api_client-14.7.2 → dataiku_api_client-14.7.3}/dataikuapi/dss/tools/__init__.py +0 -0
  90. {dataiku_api_client-14.7.2 → dataiku_api_client-14.7.3}/dataikuapi/dss/tools/codegen.py +0 -0
  91. {dataiku_api_client-14.7.2 → dataiku_api_client-14.7.3}/dataikuapi/dss/tools/langchain.py +0 -0
  92. {dataiku_api_client-14.7.2 → dataiku_api_client-14.7.3}/dataikuapi/dss/unifiedmonitoring.py +0 -0
  93. {dataiku_api_client-14.7.2 → dataiku_api_client-14.7.3}/dataikuapi/dss/utils.py +0 -0
  94. {dataiku_api_client-14.7.2 → dataiku_api_client-14.7.3}/dataikuapi/dss/webapp.py +0 -0
  95. {dataiku_api_client-14.7.2 → dataiku_api_client-14.7.3}/dataikuapi/dss/wiki.py +0 -0
  96. {dataiku_api_client-14.7.2 → dataiku_api_client-14.7.3}/dataikuapi/dss/workspace.py +0 -0
  97. {dataiku_api_client-14.7.2 → dataiku_api_client-14.7.3}/dataikuapi/dss_plugin_mlflow/__init__.py +0 -0
  98. {dataiku_api_client-14.7.2 → dataiku_api_client-14.7.3}/dataikuapi/dss_plugin_mlflow/artifact_repository.py +0 -0
  99. {dataiku_api_client-14.7.2 → dataiku_api_client-14.7.3}/dataikuapi/dss_plugin_mlflow/header_provider.py +0 -0
  100. {dataiku_api_client-14.7.2 → dataiku_api_client-14.7.3}/dataikuapi/dss_plugin_mlflow/utils.py +0 -0
  101. {dataiku_api_client-14.7.2 → dataiku_api_client-14.7.3}/dataikuapi/fm/__init__.py +0 -0
  102. {dataiku_api_client-14.7.2 → dataiku_api_client-14.7.3}/dataikuapi/fm/cloudaccounts.py +0 -0
  103. {dataiku_api_client-14.7.2 → dataiku_api_client-14.7.3}/dataikuapi/fm/future.py +0 -0
  104. {dataiku_api_client-14.7.2 → dataiku_api_client-14.7.3}/dataikuapi/fm/instances.py +0 -0
  105. {dataiku_api_client-14.7.2 → dataiku_api_client-14.7.3}/dataikuapi/fm/instancesettingstemplates.py +0 -0
  106. {dataiku_api_client-14.7.2 → dataiku_api_client-14.7.3}/dataikuapi/fm/loadbalancers.py +0 -0
  107. {dataiku_api_client-14.7.2 → dataiku_api_client-14.7.3}/dataikuapi/fm/tenant.py +0 -0
  108. {dataiku_api_client-14.7.2 → dataiku_api_client-14.7.3}/dataikuapi/fm/virtualnetworks.py +0 -0
  109. {dataiku_api_client-14.7.2 → dataiku_api_client-14.7.3}/dataikuapi/fmclient.py +0 -0
  110. {dataiku_api_client-14.7.2 → dataiku_api_client-14.7.3}/dataikuapi/govern/__init__.py +0 -0
  111. {dataiku_api_client-14.7.2 → dataiku_api_client-14.7.3}/dataikuapi/govern/admin.py +0 -0
  112. {dataiku_api_client-14.7.2 → dataiku_api_client-14.7.3}/dataikuapi/govern/admin_blueprint_designer.py +0 -0
  113. {dataiku_api_client-14.7.2 → dataiku_api_client-14.7.3}/dataikuapi/govern/admin_custom_pages_handler.py +0 -0
  114. {dataiku_api_client-14.7.2 → dataiku_api_client-14.7.3}/dataikuapi/govern/admin_roles_permissions_handler.py +0 -0
  115. {dataiku_api_client-14.7.2 → dataiku_api_client-14.7.3}/dataikuapi/govern/artifact.py +0 -0
  116. {dataiku_api_client-14.7.2 → dataiku_api_client-14.7.3}/dataikuapi/govern/artifact_search.py +0 -0
  117. {dataiku_api_client-14.7.2 → dataiku_api_client-14.7.3}/dataikuapi/govern/blueprint.py +0 -0
  118. {dataiku_api_client-14.7.2 → dataiku_api_client-14.7.3}/dataikuapi/govern/custom_page.py +0 -0
  119. {dataiku_api_client-14.7.2 → dataiku_api_client-14.7.3}/dataikuapi/govern/future.py +0 -0
  120. {dataiku_api_client-14.7.2 → dataiku_api_client-14.7.3}/dataikuapi/govern/time_series.py +0 -0
  121. {dataiku_api_client-14.7.2 → dataiku_api_client-14.7.3}/dataikuapi/govern/uploaded_file.py +0 -0
  122. {dataiku_api_client-14.7.2 → dataiku_api_client-14.7.3}/dataikuapi/govern/users_container.py +0 -0
  123. {dataiku_api_client-14.7.2 → dataiku_api_client-14.7.3}/dataikuapi/govern_client.py +0 -0
  124. {dataiku_api_client-14.7.2 → dataiku_api_client-14.7.3}/dataikuapi/iam/__init__.py +0 -0
  125. {dataiku_api_client-14.7.2 → dataiku_api_client-14.7.3}/dataikuapi/iam/settings.py +0 -0
  126. {dataiku_api_client-14.7.2 → dataiku_api_client-14.7.3}/dataikuapi/launchpad/__init__.py +0 -0
  127. {dataiku_api_client-14.7.2 → dataiku_api_client-14.7.3}/dataikuapi/launchpad/exceptions.py +0 -0
  128. {dataiku_api_client-14.7.2 → dataiku_api_client-14.7.3}/dataikuapi/launchpad/group.py +0 -0
  129. {dataiku_api_client-14.7.2 → dataiku_api_client-14.7.3}/dataikuapi/launchpad/node.py +0 -0
  130. {dataiku_api_client-14.7.2 → dataiku_api_client-14.7.3}/dataikuapi/launchpad/profile.py +0 -0
  131. {dataiku_api_client-14.7.2 → dataiku_api_client-14.7.3}/dataikuapi/launchpad/response.py +0 -0
  132. {dataiku_api_client-14.7.2 → dataiku_api_client-14.7.3}/dataikuapi/launchpad/task.py +0 -0
  133. {dataiku_api_client-14.7.2 → dataiku_api_client-14.7.3}/dataikuapi/launchpad/user.py +0 -0
  134. {dataiku_api_client-14.7.2 → dataiku_api_client-14.7.3}/dataikuapi/launchpad_client.py +0 -0
  135. {dataiku_api_client-14.7.2 → dataiku_api_client-14.7.3}/dataikuapi/utils.py +0 -0
  136. {dataiku_api_client-14.7.2 → dataiku_api_client-14.7.3}/requirements.txt +0 -0
  137. {dataiku_api_client-14.7.2 → dataiku_api_client-14.7.3}/setup.cfg +0 -0
@@ -2,6 +2,11 @@ Changelog
2
2
  ==========
3
3
 
4
4
 
5
+ 14.7.3 (2026-08-03)
6
+ -------------------
7
+
8
+ * Initial release for DSS 14.7.3
9
+
5
10
  14.7.2 (2026-07-13)
6
11
  -------------------
7
12
 
@@ -1,9 +1,9 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: dataiku-api-client
3
- Version: 14.7.2
3
+ Version: 14.7.3
4
4
  Summary: Python API client for Dataiku APIs
5
5
  Home-page: https://www.dataiku.com
6
- Download-URL: https://github.com/dataiku/dataiku-api-client-python/tarball/14.7.2
6
+ Download-URL: https://github.com/dataiku/dataiku-api-client-python/tarball/14.7.3
7
7
  Author: Dataiku
8
8
  Author-email: support@dataiku.com
9
9
  License: Apache Software License
@@ -36,6 +36,11 @@ Changelog
36
36
  ==========
37
37
 
38
38
 
39
+ 14.7.3 (2026-08-03)
40
+ -------------------
41
+
42
+ * Initial release for DSS 14.7.3
43
+
39
44
  14.7.2 (2026-07-13)
40
45
  -------------------
41
46
 
@@ -1,9 +1,9 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: dataiku-api-client
3
- Version: 14.7.2
3
+ Version: 14.7.3
4
4
  Summary: Python API client for Dataiku APIs
5
5
  Home-page: https://www.dataiku.com
6
- Download-URL: https://github.com/dataiku/dataiku-api-client-python/tarball/14.7.2
6
+ Download-URL: https://github.com/dataiku/dataiku-api-client-python/tarball/14.7.3
7
7
  Author: Dataiku
8
8
  Author-email: support@dataiku.com
9
9
  License: Apache Software License
@@ -36,6 +36,11 @@ Changelog
36
36
  ==========
37
37
 
38
38
 
39
+ 14.7.3 (2026-08-03)
40
+ -------------------
41
+
42
+ * Initial release for DSS 14.7.3
43
+
39
44
  14.7.2 (2026-07-13)
40
45
  -------------------
41
46
 
@@ -61,6 +61,7 @@ dataikuapi/dss/managedfolder.py
61
61
  dataikuapi/dss/meaning.py
62
62
  dataikuapi/dss/messaging_channel.py
63
63
  dataikuapi/dss/metrics.py
64
+ dataikuapi/dss/mira.py
64
65
  dataikuapi/dss/ml.py
65
66
  dataikuapi/dss/mlflow.py
66
67
  dataikuapi/dss/modelcomparison.py
@@ -64,7 +64,7 @@ class DSSAgentTool(object):
64
64
  """
65
65
  return self.tool_id
66
66
 
67
- def get_descriptor(self):
67
+ def get_descriptor(self, context=None):
68
68
  """
69
69
  Get the descriptor of the tool
70
70
 
@@ -73,7 +73,10 @@ class DSSAgentTool(object):
73
73
  """
74
74
 
75
75
  if self._descriptor is None:
76
- self._descriptor = self.client._perform_json("GET", "/projects/%s/agents/tools/%s/descriptor" % (self.project_key, self.tool_id))
76
+ if context is None:
77
+ self._descriptor = self.client._perform_json("GET", "/projects/%s/agents/tools/%s/descriptor" % (self.project_key, self.tool_id))
78
+ else:
79
+ self._descriptor = self.client._perform_json("POST", "/projects/%s/agents/tools/%s/descriptor" % (self.project_key, self.tool_id), body={"context": context})
77
80
  return self._descriptor
78
81
 
79
82
  def get_settings(self):
@@ -2,16 +2,25 @@
2
2
  import asyncio
3
3
  import concurrent
4
4
  import logging
5
- import threading
5
+ import threading
6
+ import itertools
6
7
 
7
8
  from typing import Callable, List, Any, Union
8
9
 
9
10
  import pydantic
11
+
12
+ _thread_pool_executor_counter = itertools.count().__next__
13
+
14
+ def next_thread_pool_executor_prefix(prefix):
15
+ return "{}-{}".format(prefix, _thread_pool_executor_counter())
16
+
10
17
  try:
11
18
  from langchain_core.embeddings.embeddings import Embeddings
12
19
  except ModuleNotFoundError:
13
20
  from langchain.embeddings.base import Embeddings
14
21
  from langchain_core.callbacks import BaseCallbackHandler, LLMManagerMixin
22
+
23
+
15
24
  from dataikuapi.dss.llm_tracing import new_trace, SpanBuilder
16
25
 
17
26
  from dataikuapi.dss.langchain.utils import must_use_deprecated_pydantic_config
@@ -121,7 +130,7 @@ class DKUEmbeddings(LockedDownBaseModel, Embeddings):
121
130
 
122
131
  async def aembed_documents(self, texts: List[str]) -> List[List[float]]:
123
132
  loop = asyncio.get_event_loop()
124
- with concurrent.futures.ThreadPoolExecutor() as executor:
133
+ with concurrent.futures.ThreadPoolExecutor(thread_name_prefix=next_thread_pool_executor_prefix("DKUEmbeddingsAsyncExecutor")) as executor:
125
134
  result = await loop.run_in_executor(executor, self.embed_documents, texts)
126
135
  return result
127
136
 
@@ -199,6 +199,8 @@ class DSSLLMEmbeddingsQuery(object):
199
199
  def new_guardrail(self, type):
200
200
  """
201
201
  Start adding a guardrail to the request. You need to configure the returned object, and call add() to actually add it
202
+
203
+ :rtype: :class:`DSSLLMRequestGuardrailBuilder`
202
204
  """
203
205
  return DSSLLMRequestGuardrailBuilder(self, type)
204
206
 
@@ -420,15 +422,27 @@ class SettingsMixin(object):
420
422
 
421
423
 
422
424
  class DSSLLMRequestGuardrailBuilder(object):
425
+ """
426
+ .. important::
427
+ Do not create this class directly, use :meth:`dataikuapi.dss.llm.DSSLLMCompletionQuery.new_guardrail`,
428
+ :meth:`dataikuapi.dss.llm.DSSLLMCompletionsQuery.new_guardrail`, :meth:`dataikuapi.dss.llm.DSSLLMEmbeddingsQuery.new_guardrail` or
429
+ :meth:`dataikuapi.dss.llm.DSSLLMImageGenerationQuery.new_guardrail`.
430
+ """
431
+
423
432
  def __init__(self, request, type):
424
433
  self.request = request
425
- self.guardrail = { "type" : type, "enabled": True, "params" : {}}
434
+ self.guardrail = {"type" : type, "enabled": True, "params" : {}}
426
435
 
427
436
  @property
428
437
  def params(self):
438
+ """
439
+ :return: The parameters of this guardrail
440
+ :rtype: dict
441
+ """
429
442
  return self.guardrail["params"]
430
443
 
431
444
  def add(self):
445
+ """Add this guardrail to the completion query"""
432
446
  if self.request._guardrails is None:
433
447
  self.request._guardrails = {"guardrails" : []}
434
448
  self.request._guardrails["guardrails"].append(self.guardrail)
@@ -537,6 +551,8 @@ class DSSLLMCompletionQuery(DSSLLMCompletionsQuerySingleQuery, SettingsMixin):
537
551
  def new_guardrail(self, type):
538
552
  """
539
553
  Start adding a guardrail to the request. You need to configure the returned object, and call add() to actually add it
554
+
555
+ :rtype: :class:`DSSLLMRequestGuardrailBuilder`
540
556
  """
541
557
  return DSSLLMRequestGuardrailBuilder(self, type)
542
558
 
@@ -638,6 +654,8 @@ class DSSLLMCompletionsQuery(SettingsMixin):
638
654
  def new_guardrail(self, type):
639
655
  """
640
656
  Start adding a guardrail to the request. You need to configure the returned object, and call add() to actually add it
657
+
658
+ :rtype: :class:`DSSLLMRequestGuardrailBuilder`
641
659
  """
642
660
  return DSSLLMRequestGuardrailBuilder(self, type)
643
661
 
@@ -664,7 +682,7 @@ class DSSLLMCompletionsQuery(SettingsMixin):
664
682
  return DSSLLMCompletionsResponse(ret["responses"], response_parser=self._response_parser)
665
683
 
666
684
 
667
- class DSSLLMCompletionQueryMultipartBuilder(object):
685
+ class _DSSLLMCompletionQueryMultipartBuilder(object):
668
686
  def __init__(self):
669
687
  self.parts = []
670
688
 
@@ -681,6 +699,8 @@ class DSSLLMCompletionQueryMultipartBuilder(object):
681
699
  def with_text(self, text):
682
700
  """
683
701
  Add a text part to the multipart message
702
+
703
+ :param str text: The text to add
684
704
  """
685
705
  self.parts.append({"type": "TEXT", "text": text})
686
706
  return self
@@ -692,7 +712,7 @@ class DSSLLMCompletionQueryMultipartBuilder(object):
692
712
  :param Union[str, bytes] image: The image
693
713
  :param str mime_type: None for default
694
714
  """
695
- img_b64 = DSSLLMCompletionQueryMultipartMessage._encode_image(image)
715
+ img_b64 = _DSSLLMCompletionQueryMultipartBuilder._encode_image(image)
696
716
 
697
717
  part = {
698
718
  "type": "IMAGE_INLINE",
@@ -713,7 +733,7 @@ class DSSLLMCompletionQueryMultipartBuilder(object):
713
733
  :param Union[str, bytes] image: The image
714
734
  :param str mime_type: None for default
715
735
  """
716
- img_b64 = DSSLLMCompletionQueryMultipartMessage._encode_image(image)
736
+ img_b64 = _DSSLLMCompletionQueryMultipartBuilder._encode_image(image)
717
737
 
718
738
  image_part = {
719
739
  "type": "IMAGE_INLINE",
@@ -736,14 +756,13 @@ class DSSLLMCompletionQueryMultipartBuilder(object):
736
756
  """
737
757
  Add an image url part to the multipart message
738
758
 
739
- :param image: str the image url
759
+ :param str image: the image url
740
760
  """
741
-
742
761
  self.parts.append({"type": "IMAGE_URI", "imageUrl": image})
743
762
  return self
744
763
 
745
764
 
746
- class DSSLLMCompletionQueryMultipartMessage(DSSLLMCompletionQueryMultipartBuilder):
765
+ class DSSLLMCompletionQueryMultipartMessage(_DSSLLMCompletionQueryMultipartBuilder):
747
766
  """
748
767
  .. important::
749
768
  Do not create this class directly, use :meth:`dataikuapi.dss.llm.DSSLLMCompletionQuery.new_multipart_message` or
@@ -761,8 +780,43 @@ class DSSLLMCompletionQueryMultipartMessage(DSSLLMCompletionQueryMultipartBuilde
761
780
  self.q.cq["messages"].append(self.msg)
762
781
  return self.q
763
782
 
783
+ def with_text(self, text):
784
+ """
785
+ Add a text part to the multipart message
786
+
787
+ :param str text: The text to add
788
+ """
789
+ return super().with_text(text)
790
+
791
+ def with_inline_image(self, image, mime_type=None):
792
+ """
793
+ Add an image part to the multipart message
794
+
795
+ :param Union[str, bytes] image: The image
796
+ :param str mime_type: None for default
797
+ """
798
+ return super().with_inline_image(image, mime_type)
764
799
 
765
- class DSSLLMCompletionQueryMultipartToolOutput(DSSLLMCompletionQueryMultipartBuilder):
800
+ def with_captioned_image_inline(self, caption, image, mime_type=None):
801
+ """
802
+ Add a captioned image part to the multipart message
803
+
804
+ :param str caption: Image caption
805
+ :param Union[str, bytes] image: The image
806
+ :param str mime_type: None for default
807
+ """
808
+ return super().with_captioned_image_inline(caption, image, mime_type)
809
+
810
+ def with_image_url(self, image):
811
+ """
812
+ Add an image url part to the multipart message
813
+
814
+ :param str image: The image url
815
+ """
816
+ return super().with_image_url(image)
817
+
818
+
819
+ class DSSLLMCompletionQueryMultipartToolOutput(_DSSLLMCompletionQueryMultipartBuilder):
766
820
  """
767
821
  .. important::
768
822
  Do not create this class directly, use :meth:`dataikuapi.dss.llm.DSSLLMCompletionQuery.new_multipart_tool_output` or
@@ -787,24 +841,75 @@ class DSSLLMCompletionQueryMultipartToolOutput(DSSLLMCompletionQueryMultipartBui
787
841
  self.q.cq["messages"].append(self.msg)
788
842
  return self.q
789
843
 
844
+ def with_text(self, text):
845
+ """
846
+ Add a text part to the multipart tool output
847
+
848
+ :param str text: The text to add
849
+ """
850
+ return super().with_text(text)
851
+
852
+ def with_inline_image(self, image, mime_type=None):
853
+ """
854
+ Add an image part to the multipart tool output
855
+
856
+ :param Union[str, bytes] image: The image
857
+ :param str mime_type: None for default
858
+ """
859
+ return super().with_inline_image(image, mime_type)
860
+
861
+ def with_captioned_image_inline(self, caption, image, mime_type=None):
862
+ """
863
+ Add a captioned image part to the multipart tool output
864
+
865
+ :param str caption: Image caption
866
+ :param Union[str, bytes] image: The image
867
+ :param str mime_type: None for default
868
+ """
869
+ return super().with_captioned_image_inline(caption, image, mime_type)
870
+
871
+ def with_image_url(self, image):
872
+ """
873
+ Add an image url part to the multipart tool output
874
+
875
+ :param str image: The image url
876
+ """
877
+ return super().with_image_url(image)
878
+
790
879
 
791
880
  class DSSLLMStreamedCompletionChunk(object):
881
+ """
882
+ A handle to interact with a streamed completion query chunk.
883
+
884
+ .. important::
885
+ Do not create this class directly, iterate over a :class:`dataikuapi.dss.llm.DSSLLMStreamedCompletionChunks` iterator instead to generate the chunks instead.
886
+ """
887
+
792
888
  def __init__(self, data):
793
889
  self.data = data
794
890
 
795
891
  @property
796
892
  def type(self):
797
- """Type of this chunk, either "content" or "event" """
893
+ """
894
+ :return: Type of this chunk, either "content" or "event"
895
+ :rtype: Literal["content", "event"]
896
+ """
798
897
  return self.data.get("type", "content")
799
898
 
800
899
  @property
801
900
  def text(self):
802
- """If this chunk is content and has text, the (partial) text"""
901
+ """
902
+ :return: If this chunk is content and has text, the (partial) text
903
+ :rtype: bool
904
+ """
803
905
  return self.data.get("text", None)
804
906
 
805
907
  @property
806
908
  def event_kind(self):
807
- """If this chunk is an event, its kind"""
909
+ """
910
+ :return: If this chunk is an event, its kind
911
+ :rtype: str
912
+ """
808
913
  return self.data.get("eventKind", None)
809
914
 
810
915
  def __repr__(self):
@@ -812,16 +917,31 @@ class DSSLLMStreamedCompletionChunk(object):
812
917
 
813
918
 
814
919
  class DSSLLMStreamedCompletionFooter(object):
920
+ """
921
+ A handle to interact with a streamed completion query footer.
922
+
923
+ .. important::
924
+ Do not create this class directly, iterate over a :class:`dataikuapi.dss.llm.DSSLLMStreamedCompletionChunks` iterator instead to generate the chunks instead.
925
+ """
926
+
815
927
  def __init__(self, data):
816
928
  self.data = data
817
929
 
818
930
  # Compatibility for code that just checks for "type""
819
931
  @property
820
932
  def type(self):
933
+ """
934
+ :return: Type of this chunk, to distinguish it from :class:`dataikuapi.dss.llm.DSSLLMStreamedCompletionChunk` chunks. Can only be "footer"
935
+ :rtype: Literal["footer"]
936
+ """
821
937
  return "footer"
822
938
 
823
939
  @property
824
940
  def trace(self):
941
+ """
942
+ :return: The trace of the completion query if available, None otherwise.
943
+ :rtype: Union[dict, None]
944
+ """
825
945
  return self.data.get("trace", None)
826
946
 
827
947
  @property
@@ -890,7 +1010,11 @@ class _SSEClient(object):
890
1010
 
891
1011
  class DSSLLMCompletionResponse(object):
892
1012
  """
893
- Response to a completion
1013
+ A handle to interact with a completion query result.
1014
+
1015
+ .. important::
1016
+ Do not create this class directly, use :meth:`dataikuapi.dss.llm.DSSLLMCompletionQuery.execute` or
1017
+ :attr:`dataikuapi.dss.llm.DSSLLMCompletionsResponse.responses` or :attr:`dataikuapi.dss.llm.DSSLLMStreamedCompletionChunks.response` instead.
894
1018
  """
895
1019
  def __init__(self, raw_resp=None, text=None, finish_reason=None, response_parser=None, trace=None, query=None):
896
1020
  if raw_resp is not None:
@@ -990,6 +1114,10 @@ class DSSLLMCompletionResponse(object):
990
1114
 
991
1115
  @property
992
1116
  def trace(self):
1117
+ """
1118
+ :return: The trace of the completion query if available, None otherwise.
1119
+ :rtype: Union[dict, None]
1120
+ """
993
1121
  return self._raw.get("trace", None)
994
1122
 
995
1123
  @property
@@ -1157,6 +1285,8 @@ class DSSLLMImageGenerationQuery(object):
1157
1285
  def new_guardrail(self, type):
1158
1286
  """
1159
1287
  Start adding a guardrail to the request. You need to configure the returned object, and call add() to actually add it
1288
+
1289
+ :rtype: :class:`DSSLLMRequestGuardrailBuilder`
1160
1290
  """
1161
1291
  return DSSLLMRequestGuardrailBuilder(self, type)
1162
1292
 
@@ -1381,6 +1511,10 @@ class DSSLLMImageGenerationResponse(object):
1381
1511
 
1382
1512
  @property
1383
1513
  def trace(self):
1514
+ """
1515
+ :return: The trace of the image generation query if available, None otherwise.
1516
+ :rtype: Union[dict, None]
1517
+ """
1384
1518
  return self._raw.get("trace", None)
1385
1519
 
1386
1520
  @property
@@ -0,0 +1,226 @@
1
+ import sys
2
+ from ..utils import CallableStr
3
+
4
+ if sys.version_info >= (3, 0):
5
+ import urllib.parse
6
+ dku_quote_fn = urllib.parse.quote
7
+ else:
8
+ import urllib
9
+ dku_quote_fn = urllib.quote
10
+
11
+
12
+ class DSSMIRA(object):
13
+ """
14
+ Handle to interact with MIRA.
15
+
16
+ Do not create this directly, use :meth:`dataikuapi.dss.DSSClient.get_mira`
17
+ """
18
+ def __init__(self, client):
19
+ self.client = client
20
+
21
+ def list_infras(self, as_objects=True):
22
+ """
23
+ Lists MIRA infrastructures.
24
+
25
+ :param boolean as_objects: if True, returns a list of :class:`DSSMIRAInfra`, else returns a list of dict.
26
+ :returns: a list - see as_objects for more information
27
+ :rtype: list
28
+ """
29
+ response = self.client._perform_json("GET", "/mira/infras")
30
+ infras = response["infras"]
31
+ if as_objects:
32
+ return [DSSMIRAInfra(self.client, infra["name"]) for infra in infras]
33
+ else:
34
+ return infras
35
+
36
+ def get_infra(self, infra_name):
37
+ """
38
+ Returns a handle to interact with a MIRA infrastructure.
39
+
40
+ :param str infra_name: MIRA infrastructure name
41
+ :rtype: :class:`DSSMIRAInfra`
42
+ """
43
+ return DSSMIRAInfra(self.client, infra_name)
44
+
45
+ def get_agent(self, infra_name, agent_id):
46
+ """
47
+ Returns a handle to interact with a MIRA agent.
48
+
49
+ :param str infra_name: MIRA infrastructure name
50
+ :param str agent_id: MIRA agent id
51
+ :rtype: :class:`DSSMIRAAgent`
52
+ """
53
+ return DSSMIRAAgent(self.client, infra_name, agent_id)
54
+
55
+
56
+ class DSSMIRAInfra(object):
57
+ """
58
+ Handle to interact with a MIRA infrastructure.
59
+
60
+ Do not create this directly, use :meth:`DSSMIRA.get_infra`.
61
+ """
62
+ def __init__(self, client, infra_name):
63
+ self.client = client
64
+ self.infra_name = infra_name
65
+
66
+ @property
67
+ def name(self):
68
+ return CallableStr(self.infra_name)
69
+
70
+ def __str__(self):
71
+ return CallableStr(self.infra_name)
72
+
73
+ def get_info(self):
74
+ """
75
+ Gets this MIRA infrastructure.
76
+
77
+ :returns: infrastructure data as a dict
78
+ :rtype: dict
79
+ """
80
+ return self.client._perform_json("GET", self._path())
81
+
82
+ def list_agents(self, as_objects=True):
83
+ """
84
+ Lists agents of this MIRA infrastructure.
85
+
86
+ :param boolean as_objects: if True, returns a list of :class:`DSSMIRAAgent`, else returns a list of dict.
87
+ :returns: a list - see as_objects for more information
88
+ :rtype: list
89
+ """
90
+ response = self.client._perform_json("GET", self._path("agents"))
91
+ agents = response["agents"]
92
+ if as_objects:
93
+ return [DSSMIRAAgent(self.client, self.infra_name, agent["id"]) for agent in agents]
94
+ else:
95
+ return agents
96
+
97
+ def get_agent(self, agent_id):
98
+ """
99
+ Returns a handle to interact with a MIRA agent in this infrastructure.
100
+
101
+ :param str agent_id: MIRA agent id
102
+ :rtype: :class:`DSSMIRAAgent`
103
+ """
104
+ return DSSMIRAAgent(self.client, self.infra_name, agent_id)
105
+
106
+ def get_uptime_metrics(self, bucket="HOUR", from_time=None, to_time=None, agent_ids=None):
107
+ """
108
+ Get uptime metrics aggregated over MIRA agents in this infrastructure.
109
+
110
+ :param str bucket: time bucket, "HOUR" or "DAY"
111
+ :param str from_time: optional inclusive ISO timestamp lower bound
112
+ :param str to_time: optional exclusive ISO timestamp upper bound
113
+ :param list agent_ids: optional list of agent ids to aggregate. Defaults to all allowed agents.
114
+ :returns: uptime metrics response as a dict
115
+ :rtype: dict
116
+ """
117
+ params = {"bucket": bucket}
118
+ if agent_ids is not None:
119
+ params["agentIds"] = agent_ids
120
+ if from_time is not None:
121
+ params["from"] = from_time
122
+ if to_time is not None:
123
+ params["to"] = to_time
124
+ return self.client._perform_json("GET", self._path("uptime-metrics"), params=params)
125
+
126
+ def _path(self, suffix=None):
127
+ path = "/mira/infras/%s" % dku_quote_fn(self.infra_name, safe="")
128
+ if suffix is not None:
129
+ path += "/" + suffix
130
+ return path
131
+
132
+
133
+ class DSSMIRAAgent(object):
134
+ """
135
+ Handle to interact with a MIRA agent.
136
+
137
+ Do not create this directly, use :meth:`DSSMIRA.get_agent` or :meth:`DSSMIRAInfra.get_agent`.
138
+ """
139
+ def __init__(self, client, infra_name, agent_id):
140
+ self.client = client
141
+ self.infra_name = infra_name
142
+ self.agent_id = agent_id
143
+
144
+ @property
145
+ def id(self):
146
+ return CallableStr(self.agent_id)
147
+
148
+ def __str__(self):
149
+ return CallableStr(self.agent_id)
150
+
151
+ def get_info(self):
152
+ """
153
+ Gets this MIRA agent.
154
+
155
+ :returns: agent data as a dict
156
+ :rtype: dict
157
+ """
158
+ return self.client._perform_json("GET", self._path())
159
+
160
+ def get_uptime_metrics(self, bucket="HOUR", from_time=None, to_time=None):
161
+ """
162
+ Get uptime metrics computed from MIRA uptime tests for this agent.
163
+
164
+ :param str bucket: time bucket, "HOUR" or "DAY"
165
+ :param str from_time: optional inclusive ISO timestamp lower bound
166
+ :param str to_time: optional exclusive ISO timestamp upper bound
167
+ :returns: uptime metrics response as a dict
168
+ :rtype: dict
169
+ """
170
+ params = {"bucket": bucket}
171
+ if from_time is not None:
172
+ params["from"] = from_time
173
+ if to_time is not None:
174
+ params["to"] = to_time
175
+ return self.client._perform_json("GET", self._path("uptime-metrics"), params=params)
176
+
177
+ def list_uptime_tests(self, from_time=None, to_time=None):
178
+ """
179
+ List raw MIRA uptime tests for this agent.
180
+
181
+ :param str from_time: optional inclusive ISO timestamp lower bound
182
+ :param str to_time: optional exclusive ISO timestamp upper bound
183
+ :returns: uptime tests response as a dict
184
+ :rtype: dict
185
+ """
186
+ params = {}
187
+ if from_time is not None:
188
+ params["from"] = from_time
189
+ if to_time is not None:
190
+ params["to"] = to_time
191
+ return self.client._perform_json("GET", self._path("uptime-tests"), params=params)
192
+
193
+ def insert_uptime_tests(self, tests):
194
+ """
195
+ Insert raw MIRA uptime test values for this agent.
196
+
197
+ :param list tests: list of test dictionaries with timestamp, responseStatus and responseTimeMs
198
+ :returns: mutation response as a dict
199
+ :rtype: dict
200
+ """
201
+ return self.client._perform_json("POST", self._path("uptime-tests"), body={"tests": tests})
202
+
203
+ def delete_uptime_tests(self, from_time=None, to_time=None):
204
+ """
205
+ Delete raw MIRA uptime tests for this agent, optionally restricted to a time range.
206
+
207
+ :param str from_time: optional inclusive ISO timestamp lower bound
208
+ :param str to_time: optional exclusive ISO timestamp upper bound
209
+ :returns: deletion response as a dict
210
+ :rtype: dict
211
+ """
212
+ params = {}
213
+ if from_time is not None:
214
+ params["from"] = from_time
215
+ if to_time is not None:
216
+ params["to"] = to_time
217
+ return self.client._perform_json("DELETE", self._path("uptime-tests"), params=params)
218
+
219
+ def _path(self, suffix=None):
220
+ path = "/mira/infras/%s/agents/%s" % (
221
+ dku_quote_fn(self.infra_name, safe=""),
222
+ dku_quote_fn(self.agent_id, safe="")
223
+ )
224
+ if suffix is not None:
225
+ path += "/" + suffix
226
+ return path
@@ -30,6 +30,7 @@ from .dss.sqlquery import DSSSQLQuery
30
30
  from .dss.discussion import DSSObjectDiscussions
31
31
  from .dss.apideployer import DSSAPIDeployer
32
32
  from .dss.projectdeployer import DSSProjectDeployer
33
+ from .dss.mira import DSSMIRA
33
34
  from .dss.project_standards import DSSProjectStandards
34
35
  from .dss.unifiedmonitoring import DSSUnifiedMonitoring
35
36
  from .dss.utils import DSSInfoMessages, Enum
@@ -1621,6 +1622,17 @@ class DSSClient(object):
1621
1622
  """
1622
1623
  return DSSProjectDeployer(self)
1623
1624
 
1625
+ ########################################################
1626
+ # MIRA
1627
+ ########################################################
1628
+
1629
+ def get_mira(self):
1630
+ """Gets a handle to work with MIRA
1631
+
1632
+ :rtype: :class:`~dataikuapi.dss.mira.DSSMIRA`
1633
+ """
1634
+ return DSSMIRA(self)
1635
+
1624
1636
  ########################################################
1625
1637
  # Unified Monitoring
1626
1638
  ########################################################
@@ -2,7 +2,7 @@
2
2
 
3
3
  from setuptools import setup
4
4
 
5
- VERSION = "14.7.2"
5
+ VERSION = "14.7.3"
6
6
 
7
7
  long_description = (open('README').read() + '\n\n' +
8
8
  open('HISTORY.txt').read())