opik 1.9.5__py3-none-any.whl → 1.9.39__py3-none-any.whl

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 (248) hide show
  1. opik/__init__.py +10 -3
  2. opik/anonymizer/__init__.py +5 -0
  3. opik/anonymizer/anonymizer.py +12 -0
  4. opik/anonymizer/factory.py +80 -0
  5. opik/anonymizer/recursive_anonymizer.py +64 -0
  6. opik/anonymizer/rules.py +56 -0
  7. opik/anonymizer/rules_anonymizer.py +35 -0
  8. opik/api_objects/dataset/rest_operations.py +5 -0
  9. opik/api_objects/experiment/experiment.py +46 -49
  10. opik/api_objects/experiment/helpers.py +34 -10
  11. opik/api_objects/local_recording.py +8 -3
  12. opik/api_objects/opik_client.py +230 -48
  13. opik/api_objects/opik_query_language.py +9 -0
  14. opik/api_objects/prompt/__init__.py +11 -3
  15. opik/api_objects/prompt/base_prompt.py +69 -0
  16. opik/api_objects/prompt/base_prompt_template.py +29 -0
  17. opik/api_objects/prompt/chat/__init__.py +1 -0
  18. opik/api_objects/prompt/chat/chat_prompt.py +193 -0
  19. opik/api_objects/prompt/chat/chat_prompt_template.py +350 -0
  20. opik/api_objects/prompt/{chat_content_renderer_registry.py → chat/content_renderer_registry.py} +37 -35
  21. opik/api_objects/prompt/client.py +101 -30
  22. opik/api_objects/prompt/text/__init__.py +1 -0
  23. opik/api_objects/prompt/text/prompt.py +174 -0
  24. opik/api_objects/prompt/{prompt_template.py → text/prompt_template.py} +10 -6
  25. opik/api_objects/prompt/types.py +1 -1
  26. opik/cli/export.py +6 -2
  27. opik/cli/usage_report/charts.py +39 -10
  28. opik/cli/usage_report/cli.py +164 -45
  29. opik/cli/usage_report/pdf.py +14 -1
  30. opik/config.py +0 -5
  31. opik/decorator/base_track_decorator.py +37 -40
  32. opik/decorator/context_manager/span_context_manager.py +9 -0
  33. opik/decorator/context_manager/trace_context_manager.py +5 -0
  34. opik/dict_utils.py +3 -3
  35. opik/evaluation/__init__.py +13 -2
  36. opik/evaluation/engine/engine.py +195 -223
  37. opik/evaluation/engine/helpers.py +8 -7
  38. opik/evaluation/engine/metrics_evaluator.py +237 -0
  39. opik/evaluation/evaluation_result.py +35 -1
  40. opik/evaluation/evaluator.py +318 -30
  41. opik/evaluation/models/litellm/util.py +78 -6
  42. opik/evaluation/models/model_capabilities.py +33 -0
  43. opik/evaluation/report.py +14 -2
  44. opik/evaluation/rest_operations.py +36 -33
  45. opik/evaluation/test_case.py +2 -2
  46. opik/evaluation/types.py +9 -1
  47. opik/exceptions.py +17 -0
  48. opik/hooks/__init__.py +17 -1
  49. opik/hooks/anonymizer_hook.py +36 -0
  50. opik/id_helpers.py +18 -0
  51. opik/integrations/adk/helpers.py +16 -7
  52. opik/integrations/adk/legacy_opik_tracer.py +7 -4
  53. opik/integrations/adk/opik_tracer.py +3 -1
  54. opik/integrations/adk/patchers/adk_otel_tracer/opik_adk_otel_tracer.py +7 -3
  55. opik/integrations/adk/recursive_callback_injector.py +1 -6
  56. opik/integrations/dspy/callback.py +1 -4
  57. opik/integrations/haystack/opik_connector.py +2 -2
  58. opik/integrations/haystack/opik_tracer.py +2 -4
  59. opik/integrations/langchain/opik_tracer.py +273 -82
  60. opik/integrations/llama_index/callback.py +110 -108
  61. opik/integrations/openai/agents/opik_tracing_processor.py +1 -2
  62. opik/integrations/openai/opik_tracker.py +1 -1
  63. opik/message_processing/batching/batchers.py +11 -7
  64. opik/message_processing/encoder_helpers.py +79 -0
  65. opik/message_processing/messages.py +25 -1
  66. opik/message_processing/online_message_processor.py +23 -8
  67. opik/opik_context.py +7 -7
  68. opik/rest_api/__init__.py +188 -12
  69. opik/rest_api/client.py +3 -0
  70. opik/rest_api/dashboards/__init__.py +4 -0
  71. opik/rest_api/dashboards/client.py +462 -0
  72. opik/rest_api/dashboards/raw_client.py +648 -0
  73. opik/rest_api/datasets/client.py +893 -89
  74. opik/rest_api/datasets/raw_client.py +1328 -87
  75. opik/rest_api/experiments/client.py +30 -2
  76. opik/rest_api/experiments/raw_client.py +26 -0
  77. opik/rest_api/feedback_definitions/types/find_feedback_definitions_request_type.py +1 -1
  78. opik/rest_api/optimizations/client.py +302 -0
  79. opik/rest_api/optimizations/raw_client.py +463 -0
  80. opik/rest_api/optimizations/types/optimization_update_status.py +3 -1
  81. opik/rest_api/prompts/__init__.py +2 -2
  82. opik/rest_api/prompts/client.py +34 -4
  83. opik/rest_api/prompts/raw_client.py +32 -2
  84. opik/rest_api/prompts/types/__init__.py +3 -1
  85. opik/rest_api/prompts/types/create_prompt_version_detail_template_structure.py +5 -0
  86. opik/rest_api/prompts/types/prompt_write_template_structure.py +5 -0
  87. opik/rest_api/spans/__init__.py +0 -2
  88. opik/rest_api/spans/client.py +148 -64
  89. opik/rest_api/spans/raw_client.py +210 -83
  90. opik/rest_api/spans/types/__init__.py +0 -2
  91. opik/rest_api/traces/client.py +241 -73
  92. opik/rest_api/traces/raw_client.py +344 -90
  93. opik/rest_api/types/__init__.py +200 -15
  94. opik/rest_api/types/aggregation_data.py +1 -0
  95. opik/rest_api/types/alert_trigger_config_public_type.py +6 -1
  96. opik/rest_api/types/alert_trigger_config_type.py +6 -1
  97. opik/rest_api/types/alert_trigger_config_write_type.py +6 -1
  98. opik/rest_api/types/automation_rule_evaluator.py +23 -1
  99. opik/rest_api/types/automation_rule_evaluator_llm_as_judge.py +2 -0
  100. opik/rest_api/types/automation_rule_evaluator_llm_as_judge_public.py +2 -0
  101. opik/rest_api/types/automation_rule_evaluator_llm_as_judge_write.py +2 -0
  102. opik/rest_api/types/{automation_rule_evaluator_object_public.py → automation_rule_evaluator_object_object_public.py} +32 -10
  103. opik/rest_api/types/automation_rule_evaluator_page_public.py +2 -2
  104. opik/rest_api/types/automation_rule_evaluator_public.py +23 -1
  105. opik/rest_api/types/automation_rule_evaluator_span_llm_as_judge.py +22 -0
  106. opik/rest_api/types/automation_rule_evaluator_span_llm_as_judge_public.py +22 -0
  107. opik/rest_api/types/automation_rule_evaluator_span_llm_as_judge_write.py +22 -0
  108. opik/rest_api/types/automation_rule_evaluator_trace_thread_llm_as_judge.py +2 -0
  109. opik/rest_api/types/automation_rule_evaluator_trace_thread_llm_as_judge_public.py +2 -0
  110. opik/rest_api/types/automation_rule_evaluator_trace_thread_llm_as_judge_write.py +2 -0
  111. opik/rest_api/types/automation_rule_evaluator_trace_thread_user_defined_metric_python.py +2 -0
  112. opik/rest_api/types/automation_rule_evaluator_trace_thread_user_defined_metric_python_public.py +2 -0
  113. opik/rest_api/types/automation_rule_evaluator_trace_thread_user_defined_metric_python_write.py +2 -0
  114. opik/rest_api/types/automation_rule_evaluator_update.py +23 -1
  115. opik/rest_api/types/automation_rule_evaluator_update_llm_as_judge.py +2 -0
  116. opik/rest_api/types/automation_rule_evaluator_update_span_llm_as_judge.py +22 -0
  117. opik/rest_api/types/automation_rule_evaluator_update_trace_thread_llm_as_judge.py +2 -0
  118. opik/rest_api/types/automation_rule_evaluator_update_trace_thread_user_defined_metric_python.py +2 -0
  119. opik/rest_api/types/automation_rule_evaluator_update_user_defined_metric_python.py +2 -0
  120. opik/rest_api/types/automation_rule_evaluator_user_defined_metric_python.py +2 -0
  121. opik/rest_api/types/automation_rule_evaluator_user_defined_metric_python_public.py +2 -0
  122. opik/rest_api/types/automation_rule_evaluator_user_defined_metric_python_write.py +2 -0
  123. opik/rest_api/types/automation_rule_evaluator_write.py +23 -1
  124. opik/rest_api/types/boolean_feedback_definition.py +25 -0
  125. opik/rest_api/types/boolean_feedback_definition_create.py +20 -0
  126. opik/rest_api/types/boolean_feedback_definition_public.py +25 -0
  127. opik/rest_api/types/boolean_feedback_definition_update.py +20 -0
  128. opik/rest_api/types/boolean_feedback_detail.py +29 -0
  129. opik/rest_api/types/boolean_feedback_detail_create.py +29 -0
  130. opik/rest_api/types/boolean_feedback_detail_public.py +29 -0
  131. opik/rest_api/types/boolean_feedback_detail_update.py +29 -0
  132. opik/rest_api/types/dashboard_page_public.py +24 -0
  133. opik/rest_api/types/dashboard_public.py +30 -0
  134. opik/rest_api/types/dataset.py +2 -0
  135. opik/rest_api/types/dataset_item.py +2 -0
  136. opik/rest_api/types/dataset_item_compare.py +2 -0
  137. opik/rest_api/types/dataset_item_filter.py +23 -0
  138. opik/rest_api/types/dataset_item_filter_operator.py +21 -0
  139. opik/rest_api/types/dataset_item_page_compare.py +1 -0
  140. opik/rest_api/types/dataset_item_page_public.py +1 -0
  141. opik/rest_api/types/dataset_item_public.py +2 -0
  142. opik/rest_api/types/dataset_item_update.py +39 -0
  143. opik/rest_api/types/dataset_item_write.py +1 -0
  144. opik/rest_api/types/dataset_public.py +2 -0
  145. opik/rest_api/types/dataset_public_status.py +5 -0
  146. opik/rest_api/types/dataset_status.py +5 -0
  147. opik/rest_api/types/dataset_version_diff.py +22 -0
  148. opik/rest_api/types/dataset_version_diff_stats.py +24 -0
  149. opik/rest_api/types/dataset_version_page_public.py +23 -0
  150. opik/rest_api/types/dataset_version_public.py +49 -0
  151. opik/rest_api/types/experiment.py +2 -0
  152. opik/rest_api/types/experiment_public.py +2 -0
  153. opik/rest_api/types/experiment_score.py +20 -0
  154. opik/rest_api/types/experiment_score_public.py +20 -0
  155. opik/rest_api/types/experiment_score_write.py +20 -0
  156. opik/rest_api/types/feedback.py +20 -1
  157. opik/rest_api/types/feedback_create.py +16 -1
  158. opik/rest_api/types/feedback_object_public.py +22 -1
  159. opik/rest_api/types/feedback_public.py +20 -1
  160. opik/rest_api/types/feedback_score_public.py +4 -0
  161. opik/rest_api/types/feedback_update.py +16 -1
  162. opik/rest_api/types/image_url.py +20 -0
  163. opik/rest_api/types/image_url_public.py +20 -0
  164. opik/rest_api/types/image_url_write.py +20 -0
  165. opik/rest_api/types/llm_as_judge_message.py +5 -1
  166. opik/rest_api/types/llm_as_judge_message_content.py +24 -0
  167. opik/rest_api/types/llm_as_judge_message_content_public.py +24 -0
  168. opik/rest_api/types/llm_as_judge_message_content_write.py +24 -0
  169. opik/rest_api/types/llm_as_judge_message_public.py +5 -1
  170. opik/rest_api/types/llm_as_judge_message_write.py +5 -1
  171. opik/rest_api/types/llm_as_judge_model_parameters.py +2 -0
  172. opik/rest_api/types/llm_as_judge_model_parameters_public.py +2 -0
  173. opik/rest_api/types/llm_as_judge_model_parameters_write.py +2 -0
  174. opik/rest_api/types/optimization.py +2 -0
  175. opik/rest_api/types/optimization_public.py +2 -0
  176. opik/rest_api/types/optimization_public_status.py +3 -1
  177. opik/rest_api/types/optimization_status.py +3 -1
  178. opik/rest_api/types/optimization_studio_config.py +27 -0
  179. opik/rest_api/types/optimization_studio_config_public.py +27 -0
  180. opik/rest_api/types/optimization_studio_config_write.py +27 -0
  181. opik/rest_api/types/optimization_studio_log.py +22 -0
  182. opik/rest_api/types/optimization_write.py +2 -0
  183. opik/rest_api/types/optimization_write_status.py +3 -1
  184. opik/rest_api/types/prompt.py +6 -0
  185. opik/rest_api/types/prompt_detail.py +6 -0
  186. opik/rest_api/types/prompt_detail_template_structure.py +5 -0
  187. opik/rest_api/types/prompt_public.py +6 -0
  188. opik/rest_api/types/prompt_public_template_structure.py +5 -0
  189. opik/rest_api/types/prompt_template_structure.py +5 -0
  190. opik/rest_api/types/prompt_version.py +2 -0
  191. opik/rest_api/types/prompt_version_detail.py +2 -0
  192. opik/rest_api/types/prompt_version_detail_template_structure.py +5 -0
  193. opik/rest_api/types/prompt_version_public.py +2 -0
  194. opik/rest_api/types/prompt_version_public_template_structure.py +5 -0
  195. opik/rest_api/types/prompt_version_template_structure.py +5 -0
  196. opik/rest_api/types/score_name.py +1 -0
  197. opik/rest_api/types/service_toggles_config.py +6 -0
  198. opik/rest_api/types/span_enrichment_options.py +31 -0
  199. opik/rest_api/types/span_filter.py +23 -0
  200. opik/rest_api/types/span_filter_operator.py +21 -0
  201. opik/rest_api/types/span_filter_write.py +23 -0
  202. opik/rest_api/types/span_filter_write_operator.py +21 -0
  203. opik/rest_api/types/span_llm_as_judge_code.py +27 -0
  204. opik/rest_api/types/span_llm_as_judge_code_public.py +27 -0
  205. opik/rest_api/types/span_llm_as_judge_code_write.py +27 -0
  206. opik/rest_api/types/span_update.py +46 -0
  207. opik/rest_api/types/studio_evaluation.py +20 -0
  208. opik/rest_api/types/studio_evaluation_public.py +20 -0
  209. opik/rest_api/types/studio_evaluation_write.py +20 -0
  210. opik/rest_api/types/studio_llm_model.py +21 -0
  211. opik/rest_api/types/studio_llm_model_public.py +21 -0
  212. opik/rest_api/types/studio_llm_model_write.py +21 -0
  213. opik/rest_api/types/studio_message.py +20 -0
  214. opik/rest_api/types/studio_message_public.py +20 -0
  215. opik/rest_api/types/studio_message_write.py +20 -0
  216. opik/rest_api/types/studio_metric.py +21 -0
  217. opik/rest_api/types/studio_metric_public.py +21 -0
  218. opik/rest_api/types/studio_metric_write.py +21 -0
  219. opik/rest_api/types/studio_optimizer.py +21 -0
  220. opik/rest_api/types/studio_optimizer_public.py +21 -0
  221. opik/rest_api/types/studio_optimizer_write.py +21 -0
  222. opik/rest_api/types/studio_prompt.py +20 -0
  223. opik/rest_api/types/studio_prompt_public.py +20 -0
  224. opik/rest_api/types/studio_prompt_write.py +20 -0
  225. opik/rest_api/types/trace.py +6 -0
  226. opik/rest_api/types/trace_public.py +6 -0
  227. opik/rest_api/types/trace_thread_filter_write.py +23 -0
  228. opik/rest_api/types/trace_thread_filter_write_operator.py +21 -0
  229. opik/rest_api/types/trace_thread_update.py +19 -0
  230. opik/rest_api/types/trace_update.py +39 -0
  231. opik/rest_api/types/value_entry.py +2 -0
  232. opik/rest_api/types/value_entry_compare.py +2 -0
  233. opik/rest_api/types/value_entry_experiment_item_bulk_write_view.py +2 -0
  234. opik/rest_api/types/value_entry_public.py +2 -0
  235. opik/rest_api/types/video_url.py +19 -0
  236. opik/rest_api/types/video_url_public.py +19 -0
  237. opik/rest_api/types/video_url_write.py +19 -0
  238. opik/synchronization.py +5 -6
  239. opik/{decorator/tracing_runtime_config.py → tracing_runtime_config.py} +6 -7
  240. {opik-1.9.5.dist-info → opik-1.9.39.dist-info}/METADATA +5 -4
  241. {opik-1.9.5.dist-info → opik-1.9.39.dist-info}/RECORD +246 -151
  242. opik/api_objects/prompt/chat_prompt_template.py +0 -164
  243. opik/api_objects/prompt/prompt.py +0 -131
  244. /opik/rest_api/{spans/types → types}/span_update_type.py +0 -0
  245. {opik-1.9.5.dist-info → opik-1.9.39.dist-info}/WHEEL +0 -0
  246. {opik-1.9.5.dist-info → opik-1.9.39.dist-info}/entry_points.txt +0 -0
  247. {opik-1.9.5.dist-info → opik-1.9.39.dist-info}/licenses/LICENSE +0 -0
  248. {opik-1.9.5.dist-info → opik-1.9.39.dist-info}/top_level.txt +0 -0
@@ -0,0 +1,462 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ import typing
4
+
5
+ from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper
6
+ from ..core.request_options import RequestOptions
7
+ from ..types.dashboard_page_public import DashboardPagePublic
8
+ from ..types.dashboard_public import DashboardPublic
9
+ from ..types.json_node_public import JsonNodePublic
10
+ from ..types.json_node_write import JsonNodeWrite
11
+ from .raw_client import AsyncRawDashboardsClient, RawDashboardsClient
12
+
13
+ # this is used as the default value for optional parameters
14
+ OMIT = typing.cast(typing.Any, ...)
15
+
16
+
17
+ class DashboardsClient:
18
+ def __init__(self, *, client_wrapper: SyncClientWrapper):
19
+ self._raw_client = RawDashboardsClient(client_wrapper=client_wrapper)
20
+
21
+ @property
22
+ def with_raw_response(self) -> RawDashboardsClient:
23
+ """
24
+ Retrieves a raw implementation of this client that returns raw responses.
25
+
26
+ Returns
27
+ -------
28
+ RawDashboardsClient
29
+ """
30
+ return self._raw_client
31
+
32
+ def find_dashboards(
33
+ self,
34
+ *,
35
+ page: typing.Optional[int] = None,
36
+ size: typing.Optional[int] = None,
37
+ name: typing.Optional[str] = None,
38
+ sorting: typing.Optional[str] = None,
39
+ request_options: typing.Optional[RequestOptions] = None,
40
+ ) -> DashboardPagePublic:
41
+ """
42
+ Find dashboards in a workspace
43
+
44
+ Parameters
45
+ ----------
46
+ page : typing.Optional[int]
47
+
48
+ size : typing.Optional[int]
49
+
50
+ name : typing.Optional[str]
51
+
52
+ sorting : typing.Optional[str]
53
+
54
+ request_options : typing.Optional[RequestOptions]
55
+ Request-specific configuration.
56
+
57
+ Returns
58
+ -------
59
+ DashboardPagePublic
60
+ Dashboard page
61
+
62
+ Examples
63
+ --------
64
+ from Opik import OpikApi
65
+ client = OpikApi(api_key="YOUR_API_KEY", workspace_name="YOUR_WORKSPACE_NAME", )
66
+ client.dashboards.find_dashboards()
67
+ """
68
+ _response = self._raw_client.find_dashboards(
69
+ page=page, size=size, name=name, sorting=sorting, request_options=request_options
70
+ )
71
+ return _response.data
72
+
73
+ def create_dashboard(
74
+ self,
75
+ *,
76
+ name: str,
77
+ config: JsonNodeWrite,
78
+ description: typing.Optional[str] = OMIT,
79
+ request_options: typing.Optional[RequestOptions] = None,
80
+ ) -> DashboardPublic:
81
+ """
82
+ Create a new dashboard in a workspace
83
+
84
+ Parameters
85
+ ----------
86
+ name : str
87
+
88
+ config : JsonNodeWrite
89
+
90
+ description : typing.Optional[str]
91
+
92
+ request_options : typing.Optional[RequestOptions]
93
+ Request-specific configuration.
94
+
95
+ Returns
96
+ -------
97
+ DashboardPublic
98
+ Created
99
+
100
+ Examples
101
+ --------
102
+ from Opik import OpikApi
103
+ client = OpikApi(api_key="YOUR_API_KEY", workspace_name="YOUR_WORKSPACE_NAME", )
104
+ client.dashboards.create_dashboard(name='name', config={'key': 'value'
105
+ }, )
106
+ """
107
+ _response = self._raw_client.create_dashboard(
108
+ name=name, config=config, description=description, request_options=request_options
109
+ )
110
+ return _response.data
111
+
112
+ def get_dashboard_by_id(
113
+ self, dashboard_id: str, *, request_options: typing.Optional[RequestOptions] = None
114
+ ) -> DashboardPublic:
115
+ """
116
+ Get dashboard by id
117
+
118
+ Parameters
119
+ ----------
120
+ dashboard_id : str
121
+
122
+ request_options : typing.Optional[RequestOptions]
123
+ Request-specific configuration.
124
+
125
+ Returns
126
+ -------
127
+ DashboardPublic
128
+ Dashboard resource
129
+
130
+ Examples
131
+ --------
132
+ from Opik import OpikApi
133
+ client = OpikApi(api_key="YOUR_API_KEY", workspace_name="YOUR_WORKSPACE_NAME", )
134
+ client.dashboards.get_dashboard_by_id(dashboard_id='dashboardId', )
135
+ """
136
+ _response = self._raw_client.get_dashboard_by_id(dashboard_id, request_options=request_options)
137
+ return _response.data
138
+
139
+ def delete_dashboard(self, dashboard_id: str, *, request_options: typing.Optional[RequestOptions] = None) -> None:
140
+ """
141
+ Delete dashboard by id
142
+
143
+ Parameters
144
+ ----------
145
+ dashboard_id : str
146
+
147
+ request_options : typing.Optional[RequestOptions]
148
+ Request-specific configuration.
149
+
150
+ Returns
151
+ -------
152
+ None
153
+
154
+ Examples
155
+ --------
156
+ from Opik import OpikApi
157
+ client = OpikApi(api_key="YOUR_API_KEY", workspace_name="YOUR_WORKSPACE_NAME", )
158
+ client.dashboards.delete_dashboard(dashboard_id='dashboardId', )
159
+ """
160
+ _response = self._raw_client.delete_dashboard(dashboard_id, request_options=request_options)
161
+ return _response.data
162
+
163
+ def update_dashboard(
164
+ self,
165
+ dashboard_id: str,
166
+ *,
167
+ name: typing.Optional[str] = OMIT,
168
+ description: typing.Optional[str] = OMIT,
169
+ config: typing.Optional[JsonNodePublic] = OMIT,
170
+ request_options: typing.Optional[RequestOptions] = None,
171
+ ) -> DashboardPublic:
172
+ """
173
+ Update dashboard by id. Partial updates are supported - only provided fields will be updated.
174
+
175
+ Parameters
176
+ ----------
177
+ dashboard_id : str
178
+
179
+ name : typing.Optional[str]
180
+
181
+ description : typing.Optional[str]
182
+
183
+ config : typing.Optional[JsonNodePublic]
184
+
185
+ request_options : typing.Optional[RequestOptions]
186
+ Request-specific configuration.
187
+
188
+ Returns
189
+ -------
190
+ DashboardPublic
191
+ Updated dashboard
192
+
193
+ Examples
194
+ --------
195
+ from Opik import OpikApi
196
+ client = OpikApi(api_key="YOUR_API_KEY", workspace_name="YOUR_WORKSPACE_NAME", )
197
+ client.dashboards.update_dashboard(dashboard_id='dashboardId', )
198
+ """
199
+ _response = self._raw_client.update_dashboard(
200
+ dashboard_id, name=name, description=description, config=config, request_options=request_options
201
+ )
202
+ return _response.data
203
+
204
+ def delete_dashboards_batch(
205
+ self, *, ids: typing.Sequence[str], request_options: typing.Optional[RequestOptions] = None
206
+ ) -> None:
207
+ """
208
+ Delete dashboards batch
209
+
210
+ Parameters
211
+ ----------
212
+ ids : typing.Sequence[str]
213
+
214
+ request_options : typing.Optional[RequestOptions]
215
+ Request-specific configuration.
216
+
217
+ Returns
218
+ -------
219
+ None
220
+
221
+ Examples
222
+ --------
223
+ from Opik import OpikApi
224
+ client = OpikApi(api_key="YOUR_API_KEY", workspace_name="YOUR_WORKSPACE_NAME", )
225
+ client.dashboards.delete_dashboards_batch(ids=['ids'], )
226
+ """
227
+ _response = self._raw_client.delete_dashboards_batch(ids=ids, request_options=request_options)
228
+ return _response.data
229
+
230
+
231
+ class AsyncDashboardsClient:
232
+ def __init__(self, *, client_wrapper: AsyncClientWrapper):
233
+ self._raw_client = AsyncRawDashboardsClient(client_wrapper=client_wrapper)
234
+
235
+ @property
236
+ def with_raw_response(self) -> AsyncRawDashboardsClient:
237
+ """
238
+ Retrieves a raw implementation of this client that returns raw responses.
239
+
240
+ Returns
241
+ -------
242
+ AsyncRawDashboardsClient
243
+ """
244
+ return self._raw_client
245
+
246
+ async def find_dashboards(
247
+ self,
248
+ *,
249
+ page: typing.Optional[int] = None,
250
+ size: typing.Optional[int] = None,
251
+ name: typing.Optional[str] = None,
252
+ sorting: typing.Optional[str] = None,
253
+ request_options: typing.Optional[RequestOptions] = None,
254
+ ) -> DashboardPagePublic:
255
+ """
256
+ Find dashboards in a workspace
257
+
258
+ Parameters
259
+ ----------
260
+ page : typing.Optional[int]
261
+
262
+ size : typing.Optional[int]
263
+
264
+ name : typing.Optional[str]
265
+
266
+ sorting : typing.Optional[str]
267
+
268
+ request_options : typing.Optional[RequestOptions]
269
+ Request-specific configuration.
270
+
271
+ Returns
272
+ -------
273
+ DashboardPagePublic
274
+ Dashboard page
275
+
276
+ Examples
277
+ --------
278
+ from Opik import AsyncOpikApi
279
+ import asyncio
280
+ client = AsyncOpikApi(api_key="YOUR_API_KEY", workspace_name="YOUR_WORKSPACE_NAME", )
281
+ async def main() -> None:
282
+ await client.dashboards.find_dashboards()
283
+ asyncio.run(main())
284
+ """
285
+ _response = await self._raw_client.find_dashboards(
286
+ page=page, size=size, name=name, sorting=sorting, request_options=request_options
287
+ )
288
+ return _response.data
289
+
290
+ async def create_dashboard(
291
+ self,
292
+ *,
293
+ name: str,
294
+ config: JsonNodeWrite,
295
+ description: typing.Optional[str] = OMIT,
296
+ request_options: typing.Optional[RequestOptions] = None,
297
+ ) -> DashboardPublic:
298
+ """
299
+ Create a new dashboard in a workspace
300
+
301
+ Parameters
302
+ ----------
303
+ name : str
304
+
305
+ config : JsonNodeWrite
306
+
307
+ description : typing.Optional[str]
308
+
309
+ request_options : typing.Optional[RequestOptions]
310
+ Request-specific configuration.
311
+
312
+ Returns
313
+ -------
314
+ DashboardPublic
315
+ Created
316
+
317
+ Examples
318
+ --------
319
+ from Opik import AsyncOpikApi
320
+ import asyncio
321
+ client = AsyncOpikApi(api_key="YOUR_API_KEY", workspace_name="YOUR_WORKSPACE_NAME", )
322
+ async def main() -> None:
323
+ await client.dashboards.create_dashboard(name='name', config={'key': 'value'
324
+ }, )
325
+ asyncio.run(main())
326
+ """
327
+ _response = await self._raw_client.create_dashboard(
328
+ name=name, config=config, description=description, request_options=request_options
329
+ )
330
+ return _response.data
331
+
332
+ async def get_dashboard_by_id(
333
+ self, dashboard_id: str, *, request_options: typing.Optional[RequestOptions] = None
334
+ ) -> DashboardPublic:
335
+ """
336
+ Get dashboard by id
337
+
338
+ Parameters
339
+ ----------
340
+ dashboard_id : str
341
+
342
+ request_options : typing.Optional[RequestOptions]
343
+ Request-specific configuration.
344
+
345
+ Returns
346
+ -------
347
+ DashboardPublic
348
+ Dashboard resource
349
+
350
+ Examples
351
+ --------
352
+ from Opik import AsyncOpikApi
353
+ import asyncio
354
+ client = AsyncOpikApi(api_key="YOUR_API_KEY", workspace_name="YOUR_WORKSPACE_NAME", )
355
+ async def main() -> None:
356
+ await client.dashboards.get_dashboard_by_id(dashboard_id='dashboardId', )
357
+ asyncio.run(main())
358
+ """
359
+ _response = await self._raw_client.get_dashboard_by_id(dashboard_id, request_options=request_options)
360
+ return _response.data
361
+
362
+ async def delete_dashboard(
363
+ self, dashboard_id: str, *, request_options: typing.Optional[RequestOptions] = None
364
+ ) -> None:
365
+ """
366
+ Delete dashboard by id
367
+
368
+ Parameters
369
+ ----------
370
+ dashboard_id : str
371
+
372
+ request_options : typing.Optional[RequestOptions]
373
+ Request-specific configuration.
374
+
375
+ Returns
376
+ -------
377
+ None
378
+
379
+ Examples
380
+ --------
381
+ from Opik import AsyncOpikApi
382
+ import asyncio
383
+ client = AsyncOpikApi(api_key="YOUR_API_KEY", workspace_name="YOUR_WORKSPACE_NAME", )
384
+ async def main() -> None:
385
+ await client.dashboards.delete_dashboard(dashboard_id='dashboardId', )
386
+ asyncio.run(main())
387
+ """
388
+ _response = await self._raw_client.delete_dashboard(dashboard_id, request_options=request_options)
389
+ return _response.data
390
+
391
+ async def update_dashboard(
392
+ self,
393
+ dashboard_id: str,
394
+ *,
395
+ name: typing.Optional[str] = OMIT,
396
+ description: typing.Optional[str] = OMIT,
397
+ config: typing.Optional[JsonNodePublic] = OMIT,
398
+ request_options: typing.Optional[RequestOptions] = None,
399
+ ) -> DashboardPublic:
400
+ """
401
+ Update dashboard by id. Partial updates are supported - only provided fields will be updated.
402
+
403
+ Parameters
404
+ ----------
405
+ dashboard_id : str
406
+
407
+ name : typing.Optional[str]
408
+
409
+ description : typing.Optional[str]
410
+
411
+ config : typing.Optional[JsonNodePublic]
412
+
413
+ request_options : typing.Optional[RequestOptions]
414
+ Request-specific configuration.
415
+
416
+ Returns
417
+ -------
418
+ DashboardPublic
419
+ Updated dashboard
420
+
421
+ Examples
422
+ --------
423
+ from Opik import AsyncOpikApi
424
+ import asyncio
425
+ client = AsyncOpikApi(api_key="YOUR_API_KEY", workspace_name="YOUR_WORKSPACE_NAME", )
426
+ async def main() -> None:
427
+ await client.dashboards.update_dashboard(dashboard_id='dashboardId', )
428
+ asyncio.run(main())
429
+ """
430
+ _response = await self._raw_client.update_dashboard(
431
+ dashboard_id, name=name, description=description, config=config, request_options=request_options
432
+ )
433
+ return _response.data
434
+
435
+ async def delete_dashboards_batch(
436
+ self, *, ids: typing.Sequence[str], request_options: typing.Optional[RequestOptions] = None
437
+ ) -> None:
438
+ """
439
+ Delete dashboards batch
440
+
441
+ Parameters
442
+ ----------
443
+ ids : typing.Sequence[str]
444
+
445
+ request_options : typing.Optional[RequestOptions]
446
+ Request-specific configuration.
447
+
448
+ Returns
449
+ -------
450
+ None
451
+
452
+ Examples
453
+ --------
454
+ from Opik import AsyncOpikApi
455
+ import asyncio
456
+ client = AsyncOpikApi(api_key="YOUR_API_KEY", workspace_name="YOUR_WORKSPACE_NAME", )
457
+ async def main() -> None:
458
+ await client.dashboards.delete_dashboards_batch(ids=['ids'], )
459
+ asyncio.run(main())
460
+ """
461
+ _response = await self._raw_client.delete_dashboards_batch(ids=ids, request_options=request_options)
462
+ return _response.data