dataiku-api-client 14.7.1__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.1 → dataiku_api_client-14.7.3}/HISTORY.txt +10 -0
  2. {dataiku_api_client-14.7.1/dataiku_api_client.egg-info → dataiku_api_client-14.7.3}/PKG-INFO +12 -2
  3. {dataiku_api_client-14.7.1 → dataiku_api_client-14.7.3/dataiku_api_client.egg-info}/PKG-INFO +12 -2
  4. {dataiku_api_client-14.7.1 → dataiku_api_client-14.7.3}/dataiku_api_client.egg-info/SOURCES.txt +1 -0
  5. {dataiku_api_client-14.7.1 → dataiku_api_client-14.7.3}/dataikuapi/dss/agent.py +45 -0
  6. {dataiku_api_client-14.7.1 → dataiku_api_client-14.7.3}/dataikuapi/dss/agent_tool.py +5 -2
  7. {dataiku_api_client-14.7.1 → dataiku_api_client-14.7.3}/dataikuapi/dss/cobuild.py +168 -4
  8. {dataiku_api_client-14.7.1 → dataiku_api_client-14.7.3}/dataikuapi/dss/knowledgebank.py +12 -3
  9. {dataiku_api_client-14.7.1 → dataiku_api_client-14.7.3}/dataikuapi/dss/langchain/embeddings.py +11 -2
  10. {dataiku_api_client-14.7.1 → dataiku_api_client-14.7.3}/dataikuapi/dss/llm.py +146 -12
  11. {dataiku_api_client-14.7.1 → dataiku_api_client-14.7.3}/dataikuapi/dss/llm_utils/__init__.py +3 -0
  12. dataiku_api_client-14.7.3/dataikuapi/dss/mira.py +226 -0
  13. {dataiku_api_client-14.7.1 → dataiku_api_client-14.7.3}/dataikuapi/dss/project.py +17 -0
  14. {dataiku_api_client-14.7.1 → dataiku_api_client-14.7.3}/dataikuapi/dss/recipe.py +42 -28
  15. {dataiku_api_client-14.7.1 → dataiku_api_client-14.7.3}/dataikuapi/dss/retrieval_augmented_llm.py +45 -0
  16. {dataiku_api_client-14.7.1 → dataiku_api_client-14.7.3}/dataikuapi/dssclient.py +12 -0
  17. {dataiku_api_client-14.7.1 → dataiku_api_client-14.7.3}/setup.py +1 -1
  18. {dataiku_api_client-14.7.1 → dataiku_api_client-14.7.3}/LICENSE.txt +0 -0
  19. {dataiku_api_client-14.7.1 → dataiku_api_client-14.7.3}/MANIFEST.in +0 -0
  20. {dataiku_api_client-14.7.1 → dataiku_api_client-14.7.3}/README +0 -0
  21. {dataiku_api_client-14.7.1 → dataiku_api_client-14.7.3}/dataiku_api_client.egg-info/dependency_links.txt +0 -0
  22. {dataiku_api_client-14.7.1 → dataiku_api_client-14.7.3}/dataiku_api_client.egg-info/requires.txt +0 -0
  23. {dataiku_api_client-14.7.1 → dataiku_api_client-14.7.3}/dataiku_api_client.egg-info/top_level.txt +0 -0
  24. {dataiku_api_client-14.7.1 → dataiku_api_client-14.7.3}/dataikuapi/__init__.py +0 -0
  25. {dataiku_api_client-14.7.1 → dataiku_api_client-14.7.3}/dataikuapi/apinode_admin/__init__.py +0 -0
  26. {dataiku_api_client-14.7.1 → dataiku_api_client-14.7.3}/dataikuapi/apinode_admin/auth.py +0 -0
  27. {dataiku_api_client-14.7.1 → dataiku_api_client-14.7.3}/dataikuapi/apinode_admin/service.py +0 -0
  28. {dataiku_api_client-14.7.1 → dataiku_api_client-14.7.3}/dataikuapi/apinode_admin_client.py +0 -0
  29. {dataiku_api_client-14.7.1 → dataiku_api_client-14.7.3}/dataikuapi/apinode_client.py +0 -0
  30. {dataiku_api_client-14.7.1 → dataiku_api_client-14.7.3}/dataikuapi/auth.py +0 -0
  31. {dataiku_api_client-14.7.1 → dataiku_api_client-14.7.3}/dataikuapi/base_client.py +0 -0
  32. {dataiku_api_client-14.7.1 → dataiku_api_client-14.7.3}/dataikuapi/dss/__init__.py +0 -0
  33. {dataiku_api_client-14.7.1 → dataiku_api_client-14.7.3}/dataikuapi/dss/admin.py +0 -0
  34. {dataiku_api_client-14.7.1 → dataiku_api_client-14.7.3}/dataikuapi/dss/agent_review.py +0 -0
  35. {dataiku_api_client-14.7.1 → dataiku_api_client-14.7.3}/dataikuapi/dss/analysis.py +0 -0
  36. {dataiku_api_client-14.7.1 → dataiku_api_client-14.7.3}/dataikuapi/dss/apideployer.py +0 -0
  37. {dataiku_api_client-14.7.1 → dataiku_api_client-14.7.3}/dataikuapi/dss/apiservice.py +0 -0
  38. {dataiku_api_client-14.7.1 → dataiku_api_client-14.7.3}/dataikuapi/dss/app.py +0 -0
  39. {dataiku_api_client-14.7.1 → dataiku_api_client-14.7.3}/dataikuapi/dss/businessapp.py +0 -0
  40. {dataiku_api_client-14.7.1 → dataiku_api_client-14.7.3}/dataikuapi/dss/codestudio.py +0 -0
  41. {dataiku_api_client-14.7.1 → dataiku_api_client-14.7.3}/dataikuapi/dss/continuousactivity.py +0 -0
  42. {dataiku_api_client-14.7.1 → dataiku_api_client-14.7.3}/dataikuapi/dss/dashboard.py +0 -0
  43. {dataiku_api_client-14.7.1 → dataiku_api_client-14.7.3}/dataikuapi/dss/data_collection.py +0 -0
  44. {dataiku_api_client-14.7.1 → dataiku_api_client-14.7.3}/dataikuapi/dss/data_directories_footprint.py +0 -0
  45. {dataiku_api_client-14.7.1 → dataiku_api_client-14.7.3}/dataikuapi/dss/data_quality.py +0 -0
  46. {dataiku_api_client-14.7.1 → dataiku_api_client-14.7.3}/dataikuapi/dss/dataset.py +0 -0
  47. {dataiku_api_client-14.7.1 → dataiku_api_client-14.7.3}/dataikuapi/dss/discussion.py +0 -0
  48. {dataiku_api_client-14.7.1 → dataiku_api_client-14.7.3}/dataikuapi/dss/document_extractor.py +0 -0
  49. {dataiku_api_client-14.7.1 → dataiku_api_client-14.7.3}/dataikuapi/dss/drift.py +0 -0
  50. {dataiku_api_client-14.7.1 → dataiku_api_client-14.7.3}/dataikuapi/dss/enterprise_asset_library.py +0 -0
  51. {dataiku_api_client-14.7.1 → dataiku_api_client-14.7.3}/dataikuapi/dss/evaluationcomparison.py +0 -0
  52. {dataiku_api_client-14.7.1 → dataiku_api_client-14.7.3}/dataikuapi/dss/evaluationstore.py +0 -0
  53. {dataiku_api_client-14.7.1 → dataiku_api_client-14.7.3}/dataikuapi/dss/feature_store.py +0 -0
  54. {dataiku_api_client-14.7.1 → dataiku_api_client-14.7.3}/dataikuapi/dss/flow.py +0 -0
  55. {dataiku_api_client-14.7.1 → dataiku_api_client-14.7.3}/dataikuapi/dss/future.py +0 -0
  56. {dataiku_api_client-14.7.1 → dataiku_api_client-14.7.3}/dataikuapi/dss/insight.py +0 -0
  57. {dataiku_api_client-14.7.1 → dataiku_api_client-14.7.3}/dataikuapi/dss/job.py +0 -0
  58. {dataiku_api_client-14.7.1 → dataiku_api_client-14.7.3}/dataikuapi/dss/jupyternotebook.py +0 -0
  59. {dataiku_api_client-14.7.1 → dataiku_api_client-14.7.3}/dataikuapi/dss/labeling_task.py +0 -0
  60. {dataiku_api_client-14.7.1 → dataiku_api_client-14.7.3}/dataikuapi/dss/langchain/__init__.py +0 -0
  61. {dataiku_api_client-14.7.1 → dataiku_api_client-14.7.3}/dataikuapi/dss/langchain/knowledge_bank.py +0 -0
  62. {dataiku_api_client-14.7.1 → dataiku_api_client-14.7.3}/dataikuapi/dss/langchain/llm.py +0 -0
  63. {dataiku_api_client-14.7.1 → dataiku_api_client-14.7.3}/dataikuapi/dss/langchain/tool.py +0 -0
  64. {dataiku_api_client-14.7.1 → dataiku_api_client-14.7.3}/dataikuapi/dss/langchain/utils.py +0 -0
  65. {dataiku_api_client-14.7.1 → dataiku_api_client-14.7.3}/dataikuapi/dss/llm_tracing/__init__.py +0 -0
  66. {dataiku_api_client-14.7.1 → dataiku_api_client-14.7.3}/dataikuapi/dss/local_model.py +0 -0
  67. {dataiku_api_client-14.7.1 → dataiku_api_client-14.7.3}/dataikuapi/dss/macro.py +0 -0
  68. {dataiku_api_client-14.7.1 → dataiku_api_client-14.7.3}/dataikuapi/dss/managedfolder.py +0 -0
  69. {dataiku_api_client-14.7.1 → dataiku_api_client-14.7.3}/dataikuapi/dss/meaning.py +0 -0
  70. {dataiku_api_client-14.7.1 → dataiku_api_client-14.7.3}/dataikuapi/dss/messaging_channel.py +0 -0
  71. {dataiku_api_client-14.7.1 → dataiku_api_client-14.7.3}/dataikuapi/dss/metrics.py +0 -0
  72. {dataiku_api_client-14.7.1 → dataiku_api_client-14.7.3}/dataikuapi/dss/ml.py +0 -0
  73. {dataiku_api_client-14.7.1 → dataiku_api_client-14.7.3}/dataikuapi/dss/mlflow.py +0 -0
  74. {dataiku_api_client-14.7.1 → dataiku_api_client-14.7.3}/dataikuapi/dss/modelcomparison.py +0 -0
  75. {dataiku_api_client-14.7.1 → dataiku_api_client-14.7.3}/dataikuapi/dss/modelevaluationstore.py +0 -0
  76. {dataiku_api_client-14.7.1 → dataiku_api_client-14.7.3}/dataikuapi/dss/notebook.py +0 -0
  77. {dataiku_api_client-14.7.1 → dataiku_api_client-14.7.3}/dataikuapi/dss/plugin.py +0 -0
  78. {dataiku_api_client-14.7.1 → dataiku_api_client-14.7.3}/dataikuapi/dss/project_standards.py +0 -0
  79. {dataiku_api_client-14.7.1 → dataiku_api_client-14.7.3}/dataikuapi/dss/projectdeployer.py +0 -0
  80. {dataiku_api_client-14.7.1 → dataiku_api_client-14.7.3}/dataikuapi/dss/projectfolder.py +0 -0
  81. {dataiku_api_client-14.7.1 → dataiku_api_client-14.7.3}/dataikuapi/dss/projectlibrary.py +0 -0
  82. {dataiku_api_client-14.7.1 → dataiku_api_client-14.7.3}/dataikuapi/dss/savedmodel.py +0 -0
  83. {dataiku_api_client-14.7.1 → dataiku_api_client-14.7.3}/dataikuapi/dss/scenario.py +0 -0
  84. {dataiku_api_client-14.7.1 → dataiku_api_client-14.7.3}/dataikuapi/dss/semantic_model.py +0 -0
  85. {dataiku_api_client-14.7.1 → dataiku_api_client-14.7.3}/dataikuapi/dss/sqlnotebook.py +0 -0
  86. {dataiku_api_client-14.7.1 → dataiku_api_client-14.7.3}/dataikuapi/dss/sqlquery.py +0 -0
  87. {dataiku_api_client-14.7.1 → dataiku_api_client-14.7.3}/dataikuapi/dss/statistics.py +0 -0
  88. {dataiku_api_client-14.7.1 → dataiku_api_client-14.7.3}/dataikuapi/dss/streaming_endpoint.py +0 -0
  89. {dataiku_api_client-14.7.1 → dataiku_api_client-14.7.3}/dataikuapi/dss/tools/__init__.py +0 -0
  90. {dataiku_api_client-14.7.1 → dataiku_api_client-14.7.3}/dataikuapi/dss/tools/codegen.py +0 -0
  91. {dataiku_api_client-14.7.1 → dataiku_api_client-14.7.3}/dataikuapi/dss/tools/langchain.py +0 -0
  92. {dataiku_api_client-14.7.1 → dataiku_api_client-14.7.3}/dataikuapi/dss/unifiedmonitoring.py +0 -0
  93. {dataiku_api_client-14.7.1 → dataiku_api_client-14.7.3}/dataikuapi/dss/utils.py +0 -0
  94. {dataiku_api_client-14.7.1 → dataiku_api_client-14.7.3}/dataikuapi/dss/webapp.py +0 -0
  95. {dataiku_api_client-14.7.1 → dataiku_api_client-14.7.3}/dataikuapi/dss/wiki.py +0 -0
  96. {dataiku_api_client-14.7.1 → dataiku_api_client-14.7.3}/dataikuapi/dss/workspace.py +0 -0
  97. {dataiku_api_client-14.7.1 → dataiku_api_client-14.7.3}/dataikuapi/dss_plugin_mlflow/__init__.py +0 -0
  98. {dataiku_api_client-14.7.1 → dataiku_api_client-14.7.3}/dataikuapi/dss_plugin_mlflow/artifact_repository.py +0 -0
  99. {dataiku_api_client-14.7.1 → dataiku_api_client-14.7.3}/dataikuapi/dss_plugin_mlflow/header_provider.py +0 -0
  100. {dataiku_api_client-14.7.1 → dataiku_api_client-14.7.3}/dataikuapi/dss_plugin_mlflow/utils.py +0 -0
  101. {dataiku_api_client-14.7.1 → dataiku_api_client-14.7.3}/dataikuapi/fm/__init__.py +0 -0
  102. {dataiku_api_client-14.7.1 → dataiku_api_client-14.7.3}/dataikuapi/fm/cloudaccounts.py +0 -0
  103. {dataiku_api_client-14.7.1 → dataiku_api_client-14.7.3}/dataikuapi/fm/future.py +0 -0
  104. {dataiku_api_client-14.7.1 → dataiku_api_client-14.7.3}/dataikuapi/fm/instances.py +0 -0
  105. {dataiku_api_client-14.7.1 → dataiku_api_client-14.7.3}/dataikuapi/fm/instancesettingstemplates.py +0 -0
  106. {dataiku_api_client-14.7.1 → dataiku_api_client-14.7.3}/dataikuapi/fm/loadbalancers.py +0 -0
  107. {dataiku_api_client-14.7.1 → dataiku_api_client-14.7.3}/dataikuapi/fm/tenant.py +0 -0
  108. {dataiku_api_client-14.7.1 → dataiku_api_client-14.7.3}/dataikuapi/fm/virtualnetworks.py +0 -0
  109. {dataiku_api_client-14.7.1 → dataiku_api_client-14.7.3}/dataikuapi/fmclient.py +0 -0
  110. {dataiku_api_client-14.7.1 → dataiku_api_client-14.7.3}/dataikuapi/govern/__init__.py +0 -0
  111. {dataiku_api_client-14.7.1 → dataiku_api_client-14.7.3}/dataikuapi/govern/admin.py +0 -0
  112. {dataiku_api_client-14.7.1 → dataiku_api_client-14.7.3}/dataikuapi/govern/admin_blueprint_designer.py +0 -0
  113. {dataiku_api_client-14.7.1 → dataiku_api_client-14.7.3}/dataikuapi/govern/admin_custom_pages_handler.py +0 -0
  114. {dataiku_api_client-14.7.1 → dataiku_api_client-14.7.3}/dataikuapi/govern/admin_roles_permissions_handler.py +0 -0
  115. {dataiku_api_client-14.7.1 → dataiku_api_client-14.7.3}/dataikuapi/govern/artifact.py +0 -0
  116. {dataiku_api_client-14.7.1 → dataiku_api_client-14.7.3}/dataikuapi/govern/artifact_search.py +0 -0
  117. {dataiku_api_client-14.7.1 → dataiku_api_client-14.7.3}/dataikuapi/govern/blueprint.py +0 -0
  118. {dataiku_api_client-14.7.1 → dataiku_api_client-14.7.3}/dataikuapi/govern/custom_page.py +0 -0
  119. {dataiku_api_client-14.7.1 → dataiku_api_client-14.7.3}/dataikuapi/govern/future.py +0 -0
  120. {dataiku_api_client-14.7.1 → dataiku_api_client-14.7.3}/dataikuapi/govern/time_series.py +0 -0
  121. {dataiku_api_client-14.7.1 → dataiku_api_client-14.7.3}/dataikuapi/govern/uploaded_file.py +0 -0
  122. {dataiku_api_client-14.7.1 → dataiku_api_client-14.7.3}/dataikuapi/govern/users_container.py +0 -0
  123. {dataiku_api_client-14.7.1 → dataiku_api_client-14.7.3}/dataikuapi/govern_client.py +0 -0
  124. {dataiku_api_client-14.7.1 → dataiku_api_client-14.7.3}/dataikuapi/iam/__init__.py +0 -0
  125. {dataiku_api_client-14.7.1 → dataiku_api_client-14.7.3}/dataikuapi/iam/settings.py +0 -0
  126. {dataiku_api_client-14.7.1 → dataiku_api_client-14.7.3}/dataikuapi/launchpad/__init__.py +0 -0
  127. {dataiku_api_client-14.7.1 → dataiku_api_client-14.7.3}/dataikuapi/launchpad/exceptions.py +0 -0
  128. {dataiku_api_client-14.7.1 → dataiku_api_client-14.7.3}/dataikuapi/launchpad/group.py +0 -0
  129. {dataiku_api_client-14.7.1 → dataiku_api_client-14.7.3}/dataikuapi/launchpad/node.py +0 -0
  130. {dataiku_api_client-14.7.1 → dataiku_api_client-14.7.3}/dataikuapi/launchpad/profile.py +0 -0
  131. {dataiku_api_client-14.7.1 → dataiku_api_client-14.7.3}/dataikuapi/launchpad/response.py +0 -0
  132. {dataiku_api_client-14.7.1 → dataiku_api_client-14.7.3}/dataikuapi/launchpad/task.py +0 -0
  133. {dataiku_api_client-14.7.1 → dataiku_api_client-14.7.3}/dataikuapi/launchpad/user.py +0 -0
  134. {dataiku_api_client-14.7.1 → dataiku_api_client-14.7.3}/dataikuapi/launchpad_client.py +0 -0
  135. {dataiku_api_client-14.7.1 → dataiku_api_client-14.7.3}/dataikuapi/utils.py +0 -0
  136. {dataiku_api_client-14.7.1 → dataiku_api_client-14.7.3}/requirements.txt +0 -0
  137. {dataiku_api_client-14.7.1 → dataiku_api_client-14.7.3}/setup.cfg +0 -0
@@ -2,6 +2,16 @@ 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
+
10
+ 14.7.2 (2026-07-13)
11
+ -------------------
12
+
13
+ * Initial release for DSS 14.7.2
14
+
5
15
  14.7.1 (2026-07-13)
6
16
  -------------------
7
17
 
@@ -1,9 +1,9 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: dataiku-api-client
3
- Version: 14.7.1
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.1
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,16 @@ 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
+
44
+ 14.7.2 (2026-07-13)
45
+ -------------------
46
+
47
+ * Initial release for DSS 14.7.2
48
+
39
49
  14.7.1 (2026-07-13)
40
50
  -------------------
41
51
 
@@ -1,9 +1,9 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: dataiku-api-client
3
- Version: 14.7.1
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.1
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,16 @@ 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
+
44
+ 14.7.2 (2026-07-13)
45
+ -------------------
46
+
47
+ * Initial release for DSS 14.7.2
48
+
39
49
  14.7.1 (2026-07-13)
40
50
  -------------------
41
51
 
@@ -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
@@ -354,6 +354,51 @@ class DSSAgent(object):
354
354
  "versionId": version_id
355
355
  })
356
356
 
357
+ def get_metrics_series(self, from_timestamp_ms=None, to_timestamp_ms=None, aggregation="MINUTE", timezone=None):
358
+ """
359
+ Get the operational metrics series for this agent.
360
+
361
+ The returned payload may include the ongoing interval for the requested granularity.
362
+ As a consequence, the latest datapoint is temporarily inconsistent and may evolve
363
+ as more raw events are flushed and aggregated at read time.
364
+ The requested time window is aligned to the bucket boundaries of the selected
365
+ aggregation before being read.
366
+
367
+ :param int from_timestamp_ms: Beginning of the requested window, inclusive, as an
368
+ epoch timestamp in milliseconds. The effective lower bound is rounded down
369
+ to the start of its bucket. Optional, defaults to the oldest retained
370
+ timestamp available for the requested aggregation.
371
+ :param int to_timestamp_ms: End of the requested window, exclusive, as an epoch
372
+ timestamp in milliseconds. The effective upper bound is rounded up to the
373
+ next bucket boundary when it falls inside a bucket.
374
+ Optional, defaults to the current time when omitted.
375
+ :param str aggregation: Aggregation granularity. Supported values are ``MINUTE``,
376
+ ``FIVE_MINUTES``, ``HOUR``, ``DAY`` and ``MONTH``.
377
+ :param str timezone: Timezone used to align bucket boundaries. Optional,
378
+ defaults to ``UTC``. Can be a timezone name like ``Europe/Paris``.
379
+ :return: The list of datapoints. Each datapoint contains a ``timestampMs``
380
+ expressed as the start timestamp of its bucket in epoch
381
+ milliseconds. For example, with ``HOUR`` aggregation, a datapoint
382
+ at ``18:00`` represents the interval ``[18:00, 19:00)``.
383
+ :rtype: list[dict]
384
+ """
385
+ if from_timestamp_ms is not None and not isinstance(from_timestamp_ms, int):
386
+ raise TypeError("Expected int for from_timestamp_ms, got %s" % type(from_timestamp_ms).__name__)
387
+ if to_timestamp_ms is not None and not isinstance(to_timestamp_ms, int):
388
+ raise TypeError("Expected int for to_timestamp_ms, got %s" % type(to_timestamp_ms).__name__)
389
+ if timezone is not None and not isinstance(timezone, str):
390
+ raise TypeError("Expected str for timezone, got %s" % type(timezone).__name__)
391
+
392
+ return self.client._perform_json(
393
+ "GET", "/projects/%s/agents/%s/operational-metrics/series" % (self.project_key, self.id),
394
+ params={
395
+ "fromTimestampMs": from_timestamp_ms,
396
+ "toTimestampMs": to_timestamp_ms,
397
+ "aggregation": aggregation,
398
+ "timezone": timezone
399
+ }
400
+ )
401
+
357
402
 
358
403
  class DSSAgentSettings(DSSTaggableObjectSettings):
359
404
  """
@@ -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):
@@ -28,7 +28,8 @@ class CobuildAssistantResponse(CobuildMessage):
28
28
 
29
29
  .. important::
30
30
  Do not create this class directly, it is returned by :meth:`DSSCobuildConversation.send_message`
31
- and :meth:`DSSCobuildConversation.answer_confirmation`.
31
+ :meth:`DSSCobuildConversation.answer_confirmation`, and
32
+ :meth:`DSSCobuildConversation.answer_question`.
32
33
  """
33
34
 
34
35
  @property
@@ -44,12 +45,14 @@ class CobuildAssistantResponse(CobuildMessage):
44
45
  def type(self):
45
46
  """
46
47
  Type of the response: ``"assistant_message"``, ``"delete_confirmation_request"``,
47
- or ``"error"``.
48
+ ``"ask_question_to_user_request"``, or ``"error"``.
48
49
 
49
50
  - ``"assistant_message"``: the assistant has completed its turn; the conversation is idle.
50
51
  - ``"delete_confirmation_request"``: the assistant is requesting confirmation before
51
52
  deleting objects. Call :meth:`DSSCobuildConversation.answer_confirmation`
52
53
  with a choice of ``"APPROVE"`` or ``"CANCEL"`` to continue.
54
+ - ``"ask_question_to_user_request"``: the assistant is requesting an explicit answer before it can
55
+ continue. Call :meth:`DSSCobuildConversation.answer_question` to continue.
53
56
  - ``"error"``: an error occurred while processing the Cobuild turn. In the public API,
54
57
  missing tool permissions are reported through this error response too.
55
58
 
@@ -82,6 +85,16 @@ class CobuildAssistantResponse(CobuildMessage):
82
85
  """
83
86
  return self.type == "delete_confirmation_request"
84
87
 
88
+ @property
89
+ def is_question_request(self):
90
+ """
91
+ Whether the assistant is requesting an explicit answer before continuing.
92
+ If ``True``, call :meth:`DSSCobuildConversation.answer_question`.
93
+
94
+ :rtype: bool
95
+ """
96
+ return self.type == "ask_question_to_user_request"
97
+
85
98
  @property
86
99
  def is_error(self):
87
100
  """
@@ -116,6 +129,72 @@ class CobuildAssistantResponse(CobuildMessage):
116
129
  """
117
130
  return self._raw.get("deletionImpacts")
118
131
 
132
+ @property
133
+ def question_id(self):
134
+ """
135
+ For ``"ask_question_to_user_request"`` responses: the identifier of the pending question.
136
+
137
+ ``None`` for other response types.
138
+
139
+ :rtype: str or None
140
+ """
141
+ return self._raw.get("questionId")
142
+
143
+ @property
144
+ def title(self):
145
+ """
146
+ For ``"ask_question_to_user_request"`` responses: the short question shown to the user.
147
+
148
+ ``None`` for other response types.
149
+
150
+ :rtype: str or None
151
+ """
152
+ return self._raw.get("title")
153
+
154
+ @property
155
+ def predefined_answers(self):
156
+ """
157
+ For ``"ask_question_to_user_request"`` responses: the list of predefined answers proposed by Cobuild.
158
+
159
+ ``None`` for other response types.
160
+
161
+ :rtype: list[str] or None
162
+ """
163
+ return self._raw.get("predefinedAnswers")
164
+
165
+ @property
166
+ def allow_custom_answer(self):
167
+ """
168
+ For ``"ask_question_to_user_request"`` responses: whether a custom free-text answer is allowed.
169
+
170
+ ``None`` for other response types.
171
+
172
+ :rtype: bool or None
173
+ """
174
+ return self._raw.get("allowCustomAnswer")
175
+
176
+ @property
177
+ def allow_multiple_answers(self):
178
+ """
179
+ For ``"ask_question_to_user_request"`` responses: whether multiple answers can be selected.
180
+
181
+ ``None`` for other response types.
182
+
183
+ :rtype: bool or None
184
+ """
185
+ return self._raw.get("allowMultipleAnswers")
186
+
187
+ @property
188
+ def default_answer_set(self):
189
+ """
190
+ For ``"ask_question_to_user_request"`` responses: whether Cobuild suggested a default answer.
191
+
192
+ ``None`` for other response types.
193
+
194
+ :rtype: bool or None
195
+ """
196
+ return self._raw.get("selectFirstAnswerByDefault")
197
+
119
198
  def __repr__(self):
120
199
  return "CobuildAssistantResponse(type=%r, message=%r)" % (self.type, self.message)
121
200
 
@@ -127,7 +206,8 @@ class CobuildUserMessage(CobuildMessage):
127
206
  .. important::
128
207
  Do not create this class directly, it is automatically created when using :meth:`dataikuapi.dss.project.DSSProject.new_cobuild_conversation`,
129
208
  :meth:`DSSCobuildConversation.send_message`, and
130
- :meth:`DSSCobuildConversation.answer_confirmation`.
209
+ :meth:`DSSCobuildConversation.answer_confirmation`, and
210
+ :meth:`DSSCobuildConversation.answer_question`.
131
211
  """
132
212
 
133
213
  @property
@@ -142,10 +222,12 @@ class CobuildUserMessage(CobuildMessage):
142
222
  @property
143
223
  def type(self):
144
224
  """
145
- Type of the message: ``"request"`` or ``"delete_confirmation_response"``.
225
+ Type of the message: ``"request"``, ``"delete_confirmation_response"``, or
226
+ ``"ask_question_to_user_response"``.
146
227
 
147
228
  - ``"request"``: a normal message sent to cobuild.
148
229
  - ``"delete_confirmation_response"``: user response when cobuild requests confirmation before deleting objects
230
+ - ``"ask_question_to_user_response"``: user response when cobuild requests an explicit answer
149
231
 
150
232
  :rtype: str
151
233
  """
@@ -160,6 +242,15 @@ class CobuildUserMessage(CobuildMessage):
160
242
  """
161
243
  return self.type == "delete_confirmation_response"
162
244
 
245
+ @property
246
+ def is_question_response(self):
247
+ """
248
+ Whether this message is the answer for assistant requesting an explicit answer.
249
+
250
+ :rtype: bool
251
+ """
252
+ return self.type == "ask_question_to_user_response"
253
+
163
254
  def __repr__(self):
164
255
  return "CobuildUserMessage(type=%r, message=%r)" % (self.type, self.message)
165
256
 
@@ -217,6 +308,31 @@ class DSSCobuildConversation(object):
217
308
  response = conv.answer_confirmation("APPROVE")
218
309
  print(response.message)
219
310
 
311
+ When the assistant needs an explicit answer, it asks a question::
312
+
313
+ response = conv.send_message("Use the best date column for sorting")
314
+ if response.is_question_request:
315
+ print("Question:", response.title)
316
+ print("Choices:", response.predefined_answers)
317
+ print("Allow custom answer:", response.allow_custom_answer)
318
+ response = conv.answer_question(
319
+ answers=["OrderDate"],
320
+ rejected=False,
321
+ used_custom_answer=False
322
+ )
323
+ print(response.message)
324
+
325
+ You can also decline answering a question::
326
+
327
+ response = conv.send_message("Pick the dataset to build")
328
+ if response.is_question_request:
329
+ response = conv.answer_question(
330
+ answers=[],
331
+ rejected=True,
332
+ used_custom_answer=False
333
+ )
334
+ print(response.message)
335
+
220
336
  If a tool requires edit permission, pass ``allow_edit_project=True`` to
221
337
  :meth:`send_message` to allow Cobuild to create and edit objects for that message.
222
338
  """
@@ -227,6 +343,7 @@ class DSSCobuildConversation(object):
227
343
  self.conversation_id = conversation_id
228
344
  self._messages = []
229
345
  self._pending_confirmation_id = None
346
+ self._pending_question_id = None
230
347
  self._selected_objects = selected_objects
231
348
 
232
349
  @property
@@ -273,6 +390,7 @@ class DSSCobuildConversation(object):
273
390
  )
274
391
  response = CobuildAssistantResponse(raw)
275
392
  self._pending_confirmation_id = raw["confirmationId"] if response.is_confirmation_request else None
393
+ self._pending_question_id = raw["questionId"] if response.is_question_request else None
276
394
  self._messages.append(response)
277
395
  return response
278
396
 
@@ -313,5 +431,51 @@ class DSSCobuildConversation(object):
313
431
  )
314
432
  response = CobuildAssistantResponse(raw)
315
433
  self._pending_confirmation_id = raw["confirmationId"] if response.is_confirmation_request else None
434
+ self._pending_question_id = raw["questionId"] if response.is_question_request else None
435
+ self._messages.append(response)
436
+ return response
437
+
438
+ def answer_question(self, answers=None, rejected=False, used_custom_answer=False):
439
+ """
440
+ Answer a pending question request and wait for the assistant's next response.
441
+
442
+ Call this after receiving a response with :attr:`~CobuildAssistantResponse.is_question_request`
443
+ set to ``True``.
444
+
445
+ The answer and assistant response are appended to :attr:`messages`.
446
+
447
+ :param list[str] answers: answers selected or entered by the user. Use an empty list when
448
+ ``rejected=True``. Defaults to ``[]``.
449
+ :param bool rejected: whether to decline answering the question
450
+ :param bool used_custom_answer: whether one of the answers came from the custom free-text input
451
+
452
+ :returns: the assistant's response after the question answer
453
+ :rtype: :class:`CobuildAssistantResponse`
454
+ """
455
+ if answers is None:
456
+ answers = []
457
+ if not isinstance(answers, list):
458
+ raise ValueError("answers must be a list of strings")
459
+ if self._pending_question_id is None:
460
+ raise ValueError("No pending question request. Call send_message first and check is_question_request.")
461
+
462
+ question_id = self._pending_question_id
463
+ self._pending_question_id = None
464
+ self._messages.append(CobuildUserMessage({
465
+ "type": "ask_question_to_user_response",
466
+ "message": None if rejected else ", ".join(answers),
467
+ }))
468
+ raw = self.client._perform_json(
469
+ "POST",
470
+ "/projects/%s/cobuild/conversations/%s/question/%s" % (self.project_key, self.conversation_id, question_id),
471
+ body={
472
+ "rejected": rejected,
473
+ "answers": answers,
474
+ "usedCustomAnswer": used_custom_answer,
475
+ },
476
+ )
477
+ response = CobuildAssistantResponse(raw)
478
+ self._pending_confirmation_id = raw["confirmationId"] if response.is_confirmation_request else None
479
+ self._pending_question_id = raw["questionId"] if response.is_question_request else None
316
480
  self._messages.append(response)
317
481
  return response
@@ -115,6 +115,16 @@ class DSSKnowledgeBank(object):
115
115
  """
116
116
  return self.client._perform_empty("DELETE", "/projects/%s/knowledge-banks/%s" % (self.project_key, self.id))
117
117
 
118
+ def clear(self):
119
+ """
120
+ Clear data in this knowledge bank.
121
+
122
+ :returns: a dict containing the method call status.
123
+ :rtype: dict
124
+ """
125
+ return self.client._perform_json(
126
+ "POST", "/projects/%s/knowledge-banks/%s/clear" % (self.project_key, self.id))
127
+
118
128
  def build(self, job_type="NON_RECURSIVE_FORCED_BUILD", wait=True):
119
129
  """
120
130
  Start a new job to build this knowledge bank and wait for it to complete.
@@ -449,18 +459,17 @@ class DSSKnowledgeBankSearchResultDocument(object):
449
459
 
450
460
  folder_smart_id = source_file_info.get("folder_ref")
451
461
  folder_full_id = source_file_info.get("folder_full_id") # deprecated but to support existing KBs
452
- folder_loc = None
453
462
 
454
463
  if folder_smart_id is not None:
455
464
  try:
456
- folder_loc = AnyLoc.from_ref("donotmatter", folder_smart_id) # unused, just to check format
465
+ _ = AnyLoc.from_ref("donotmatter", folder_smart_id) # unused, just to check format
457
466
  return ManagedFolderDocumentRef(path, folder_smart_id)
458
467
  except ValueError as e:
459
468
  logger.error("Invalid folder_ref in DKU_DOCUMENT_INFO: {}, {}".format(e, document_info))
460
469
  return None
461
470
  elif folder_full_id is not None:
462
471
  try:
463
- folder_loc = AnyLoc.from_full(folder_full_id) # unused, just to check format
472
+ _ = AnyLoc.from_full(folder_full_id) # unused, just to check format
464
473
  return ManagedFolderDocumentRef(path, folder_full_id)
465
474
  except ValueError as e:
466
475
  logger.error("Invalid folder_full_id in DKU_DOCUMENT_INFO: {}, {}".format(e, document_info))
@@ -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