opik 1.9.41__py3-none-any.whl → 1.9.86__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.
- opik/api_objects/attachment/attachment_context.py +36 -0
- opik/api_objects/attachment/attachments_extractor.py +153 -0
- opik/api_objects/attachment/client.py +1 -0
- opik/api_objects/attachment/converters.py +2 -0
- opik/api_objects/attachment/decoder.py +18 -0
- opik/api_objects/attachment/decoder_base64.py +83 -0
- opik/api_objects/attachment/decoder_helpers.py +137 -0
- opik/api_objects/constants.py +2 -0
- opik/api_objects/dataset/dataset.py +133 -40
- opik/api_objects/dataset/rest_operations.py +2 -0
- opik/api_objects/experiment/experiment.py +6 -0
- opik/api_objects/helpers.py +8 -4
- opik/api_objects/local_recording.py +6 -5
- opik/api_objects/observation_data.py +101 -0
- opik/api_objects/opik_client.py +78 -45
- opik/api_objects/opik_query_language.py +9 -3
- opik/api_objects/prompt/chat/chat_prompt.py +18 -1
- opik/api_objects/prompt/client.py +8 -1
- opik/api_objects/span/span_data.py +3 -88
- opik/api_objects/threads/threads_client.py +7 -4
- opik/api_objects/trace/trace_data.py +3 -74
- opik/api_objects/validation_helpers.py +3 -3
- opik/cli/exports/__init__.py +131 -0
- opik/cli/exports/dataset.py +278 -0
- opik/cli/exports/experiment.py +784 -0
- opik/cli/exports/project.py +685 -0
- opik/cli/exports/prompt.py +578 -0
- opik/cli/exports/utils.py +406 -0
- opik/cli/harbor.py +39 -0
- opik/cli/imports/__init__.py +439 -0
- opik/cli/imports/dataset.py +143 -0
- opik/cli/imports/experiment.py +1192 -0
- opik/cli/imports/project.py +262 -0
- opik/cli/imports/prompt.py +177 -0
- opik/cli/imports/utils.py +280 -0
- opik/cli/main.py +14 -12
- opik/config.py +12 -1
- opik/datetime_helpers.py +12 -0
- opik/decorator/arguments_helpers.py +4 -1
- opik/decorator/base_track_decorator.py +111 -37
- opik/decorator/context_manager/span_context_manager.py +5 -1
- opik/decorator/generator_wrappers.py +5 -4
- opik/decorator/span_creation_handler.py +13 -4
- opik/evaluation/engine/engine.py +111 -28
- opik/evaluation/engine/evaluation_tasks_executor.py +71 -19
- opik/evaluation/evaluator.py +12 -0
- opik/evaluation/metrics/conversation/llm_judges/conversational_coherence/metric.py +3 -1
- opik/evaluation/metrics/conversation/llm_judges/session_completeness/metric.py +3 -1
- opik/evaluation/metrics/conversation/llm_judges/user_frustration/metric.py +3 -1
- opik/evaluation/metrics/heuristics/equals.py +11 -7
- opik/evaluation/metrics/llm_judges/answer_relevance/metric.py +3 -1
- opik/evaluation/metrics/llm_judges/context_precision/metric.py +3 -1
- opik/evaluation/metrics/llm_judges/context_recall/metric.py +3 -1
- opik/evaluation/metrics/llm_judges/factuality/metric.py +1 -1
- opik/evaluation/metrics/llm_judges/g_eval/metric.py +3 -1
- opik/evaluation/metrics/llm_judges/hallucination/metric.py +3 -1
- opik/evaluation/metrics/llm_judges/moderation/metric.py +3 -1
- opik/evaluation/metrics/llm_judges/structure_output_compliance/metric.py +3 -1
- opik/evaluation/metrics/llm_judges/syc_eval/metric.py +4 -2
- opik/evaluation/metrics/llm_judges/trajectory_accuracy/metric.py +3 -1
- opik/evaluation/metrics/llm_judges/usefulness/metric.py +3 -1
- opik/evaluation/metrics/ragas_metric.py +43 -23
- opik/evaluation/models/litellm/litellm_chat_model.py +7 -2
- opik/evaluation/models/litellm/util.py +4 -20
- opik/evaluation/models/models_factory.py +19 -5
- opik/evaluation/rest_operations.py +3 -3
- opik/evaluation/threads/helpers.py +3 -2
- opik/file_upload/file_uploader.py +13 -0
- opik/file_upload/upload_options.py +2 -0
- opik/integrations/adk/legacy_opik_tracer.py +9 -11
- opik/integrations/adk/opik_tracer.py +2 -2
- opik/integrations/adk/patchers/adk_otel_tracer/opik_adk_otel_tracer.py +2 -2
- opik/integrations/dspy/callback.py +100 -14
- opik/integrations/dspy/parsers.py +168 -0
- opik/integrations/harbor/__init__.py +17 -0
- opik/integrations/harbor/experiment_service.py +269 -0
- opik/integrations/harbor/opik_tracker.py +528 -0
- opik/integrations/haystack/opik_tracer.py +2 -2
- opik/integrations/langchain/__init__.py +15 -2
- opik/integrations/langchain/langgraph_tracer_injector.py +88 -0
- opik/integrations/langchain/opik_tracer.py +258 -160
- opik/integrations/langchain/provider_usage_extractors/langchain_run_helpers/helpers.py +7 -4
- opik/integrations/llama_index/callback.py +43 -6
- opik/integrations/openai/agents/opik_tracing_processor.py +8 -10
- opik/integrations/openai/opik_tracker.py +99 -4
- opik/integrations/openai/videos/__init__.py +9 -0
- opik/integrations/openai/videos/binary_response_write_to_file_decorator.py +88 -0
- opik/integrations/openai/videos/videos_create_decorator.py +159 -0
- opik/integrations/openai/videos/videos_download_decorator.py +110 -0
- opik/message_processing/batching/base_batcher.py +14 -21
- opik/message_processing/batching/batch_manager.py +22 -10
- opik/message_processing/batching/batchers.py +32 -40
- opik/message_processing/batching/flushing_thread.py +0 -3
- opik/message_processing/emulation/emulator_message_processor.py +36 -1
- opik/message_processing/emulation/models.py +21 -0
- opik/message_processing/messages.py +9 -0
- opik/message_processing/preprocessing/__init__.py +0 -0
- opik/message_processing/preprocessing/attachments_preprocessor.py +70 -0
- opik/message_processing/preprocessing/batching_preprocessor.py +53 -0
- opik/message_processing/preprocessing/constants.py +1 -0
- opik/message_processing/preprocessing/file_upload_preprocessor.py +38 -0
- opik/message_processing/preprocessing/preprocessor.py +36 -0
- opik/message_processing/processors/__init__.py +0 -0
- opik/message_processing/processors/attachments_extraction_processor.py +146 -0
- opik/message_processing/{message_processors.py → processors/message_processors.py} +15 -1
- opik/message_processing/{message_processors_chain.py → processors/message_processors_chain.py} +3 -2
- opik/message_processing/{online_message_processor.py → processors/online_message_processor.py} +11 -9
- opik/message_processing/queue_consumer.py +4 -2
- opik/message_processing/streamer.py +71 -33
- opik/message_processing/streamer_constructors.py +36 -8
- opik/plugins/pytest/experiment_runner.py +1 -1
- opik/plugins/pytest/hooks.py +5 -3
- opik/rest_api/__init__.py +38 -0
- opik/rest_api/datasets/client.py +249 -148
- opik/rest_api/datasets/raw_client.py +356 -217
- opik/rest_api/experiments/client.py +26 -0
- opik/rest_api/experiments/raw_client.py +26 -0
- opik/rest_api/llm_provider_key/client.py +4 -4
- opik/rest_api/llm_provider_key/raw_client.py +4 -4
- opik/rest_api/llm_provider_key/types/provider_api_key_write_provider.py +2 -1
- opik/rest_api/manual_evaluation/client.py +101 -0
- opik/rest_api/manual_evaluation/raw_client.py +172 -0
- opik/rest_api/optimizations/client.py +0 -166
- opik/rest_api/optimizations/raw_client.py +0 -248
- opik/rest_api/projects/client.py +9 -0
- opik/rest_api/projects/raw_client.py +13 -0
- opik/rest_api/projects/types/project_metric_request_public_metric_type.py +4 -0
- opik/rest_api/prompts/client.py +130 -2
- opik/rest_api/prompts/raw_client.py +175 -0
- opik/rest_api/traces/client.py +101 -0
- opik/rest_api/traces/raw_client.py +120 -0
- opik/rest_api/types/__init__.py +46 -0
- opik/rest_api/types/audio_url.py +19 -0
- opik/rest_api/types/audio_url_public.py +19 -0
- opik/rest_api/types/audio_url_write.py +19 -0
- opik/rest_api/types/automation_rule_evaluator.py +38 -2
- opik/rest_api/types/automation_rule_evaluator_object_object_public.py +33 -2
- opik/rest_api/types/automation_rule_evaluator_public.py +33 -2
- opik/rest_api/types/automation_rule_evaluator_span_user_defined_metric_python.py +22 -0
- opik/rest_api/types/automation_rule_evaluator_span_user_defined_metric_python_public.py +22 -0
- opik/rest_api/types/automation_rule_evaluator_span_user_defined_metric_python_write.py +22 -0
- opik/rest_api/types/automation_rule_evaluator_update.py +27 -1
- opik/rest_api/types/automation_rule_evaluator_update_span_user_defined_metric_python.py +22 -0
- opik/rest_api/types/automation_rule_evaluator_write.py +27 -1
- opik/rest_api/types/dataset_item.py +1 -1
- opik/rest_api/types/dataset_item_batch.py +4 -0
- opik/rest_api/types/dataset_item_changes_public.py +5 -0
- opik/rest_api/types/dataset_item_compare.py +1 -1
- opik/rest_api/types/dataset_item_filter.py +4 -0
- opik/rest_api/types/dataset_item_page_compare.py +0 -1
- opik/rest_api/types/dataset_item_page_public.py +0 -1
- opik/rest_api/types/dataset_item_public.py +1 -1
- opik/rest_api/types/dataset_version_public.py +5 -0
- opik/rest_api/types/dataset_version_summary.py +5 -0
- opik/rest_api/types/dataset_version_summary_public.py +5 -0
- opik/rest_api/types/experiment.py +9 -0
- opik/rest_api/types/experiment_public.py +9 -0
- opik/rest_api/types/llm_as_judge_message_content.py +2 -0
- opik/rest_api/types/llm_as_judge_message_content_public.py +2 -0
- opik/rest_api/types/llm_as_judge_message_content_write.py +2 -0
- opik/rest_api/types/manual_evaluation_request_entity_type.py +1 -1
- opik/rest_api/types/project.py +1 -0
- opik/rest_api/types/project_detailed.py +1 -0
- opik/rest_api/types/project_metric_response_public_metric_type.py +4 -0
- opik/rest_api/types/project_reference.py +31 -0
- opik/rest_api/types/project_reference_public.py +31 -0
- opik/rest_api/types/project_stats_summary_item.py +1 -0
- opik/rest_api/types/prompt_version.py +1 -0
- opik/rest_api/types/prompt_version_detail.py +1 -0
- opik/rest_api/types/prompt_version_page_public.py +5 -0
- opik/rest_api/types/prompt_version_public.py +1 -0
- opik/rest_api/types/prompt_version_update.py +33 -0
- opik/rest_api/types/provider_api_key.py +5 -1
- opik/rest_api/types/provider_api_key_provider.py +2 -1
- opik/rest_api/types/provider_api_key_public.py +5 -1
- opik/rest_api/types/provider_api_key_public_provider.py +2 -1
- opik/rest_api/types/service_toggles_config.py +11 -1
- opik/rest_api/types/span_user_defined_metric_python_code.py +20 -0
- opik/rest_api/types/span_user_defined_metric_python_code_public.py +20 -0
- opik/rest_api/types/span_user_defined_metric_python_code_write.py +20 -0
- opik/types.py +36 -0
- opik/validation/chat_prompt_messages.py +241 -0
- opik/validation/feedback_score.py +3 -3
- opik/validation/validator.py +28 -0
- {opik-1.9.41.dist-info → opik-1.9.86.dist-info}/METADATA +5 -5
- {opik-1.9.41.dist-info → opik-1.9.86.dist-info}/RECORD +190 -141
- opik/cli/export.py +0 -791
- opik/cli/import_command.py +0 -575
- {opik-1.9.41.dist-info → opik-1.9.86.dist-info}/WHEEL +0 -0
- {opik-1.9.41.dist-info → opik-1.9.86.dist-info}/entry_points.txt +0 -0
- {opik-1.9.41.dist-info → opik-1.9.86.dist-info}/licenses/LICENSE +0 -0
- {opik-1.9.41.dist-info → opik-1.9.86.dist-info}/top_level.txt +0 -0
opik/rest_api/types/__init__.py
CHANGED
|
@@ -37,11 +37,15 @@ from .assistant_message import AssistantMessage
|
|
|
37
37
|
from .assistant_message_role import AssistantMessageRole
|
|
38
38
|
from .attachment import Attachment
|
|
39
39
|
from .attachment_page import AttachmentPage
|
|
40
|
+
from .audio_url import AudioUrl
|
|
41
|
+
from .audio_url_public import AudioUrlPublic
|
|
42
|
+
from .audio_url_write import AudioUrlWrite
|
|
40
43
|
from .auth_details_holder import AuthDetailsHolder
|
|
41
44
|
from .automation_rule_evaluator import (
|
|
42
45
|
AutomationRuleEvaluator,
|
|
43
46
|
AutomationRuleEvaluator_LlmAsJudge,
|
|
44
47
|
AutomationRuleEvaluator_SpanLlmAsJudge,
|
|
48
|
+
AutomationRuleEvaluator_SpanUserDefinedMetricPython,
|
|
45
49
|
AutomationRuleEvaluator_TraceThreadLlmAsJudge,
|
|
46
50
|
AutomationRuleEvaluator_TraceThreadUserDefinedMetricPython,
|
|
47
51
|
AutomationRuleEvaluator_UserDefinedMetricPython,
|
|
@@ -53,6 +57,7 @@ from .automation_rule_evaluator_object_object_public import (
|
|
|
53
57
|
AutomationRuleEvaluatorObjectObjectPublic,
|
|
54
58
|
AutomationRuleEvaluatorObjectObjectPublic_LlmAsJudge,
|
|
55
59
|
AutomationRuleEvaluatorObjectObjectPublic_SpanLlmAsJudge,
|
|
60
|
+
AutomationRuleEvaluatorObjectObjectPublic_SpanUserDefinedMetricPython,
|
|
56
61
|
AutomationRuleEvaluatorObjectObjectPublic_TraceThreadLlmAsJudge,
|
|
57
62
|
AutomationRuleEvaluatorObjectObjectPublic_TraceThreadUserDefinedMetricPython,
|
|
58
63
|
AutomationRuleEvaluatorObjectObjectPublic_UserDefinedMetricPython,
|
|
@@ -62,6 +67,7 @@ from .automation_rule_evaluator_public import (
|
|
|
62
67
|
AutomationRuleEvaluatorPublic,
|
|
63
68
|
AutomationRuleEvaluatorPublic_LlmAsJudge,
|
|
64
69
|
AutomationRuleEvaluatorPublic_SpanLlmAsJudge,
|
|
70
|
+
AutomationRuleEvaluatorPublic_SpanUserDefinedMetricPython,
|
|
65
71
|
AutomationRuleEvaluatorPublic_TraceThreadLlmAsJudge,
|
|
66
72
|
AutomationRuleEvaluatorPublic_TraceThreadUserDefinedMetricPython,
|
|
67
73
|
AutomationRuleEvaluatorPublic_UserDefinedMetricPython,
|
|
@@ -69,6 +75,15 @@ from .automation_rule_evaluator_public import (
|
|
|
69
75
|
from .automation_rule_evaluator_span_llm_as_judge import AutomationRuleEvaluatorSpanLlmAsJudge
|
|
70
76
|
from .automation_rule_evaluator_span_llm_as_judge_public import AutomationRuleEvaluatorSpanLlmAsJudgePublic
|
|
71
77
|
from .automation_rule_evaluator_span_llm_as_judge_write import AutomationRuleEvaluatorSpanLlmAsJudgeWrite
|
|
78
|
+
from .automation_rule_evaluator_span_user_defined_metric_python import (
|
|
79
|
+
AutomationRuleEvaluatorSpanUserDefinedMetricPython,
|
|
80
|
+
)
|
|
81
|
+
from .automation_rule_evaluator_span_user_defined_metric_python_public import (
|
|
82
|
+
AutomationRuleEvaluatorSpanUserDefinedMetricPythonPublic,
|
|
83
|
+
)
|
|
84
|
+
from .automation_rule_evaluator_span_user_defined_metric_python_write import (
|
|
85
|
+
AutomationRuleEvaluatorSpanUserDefinedMetricPythonWrite,
|
|
86
|
+
)
|
|
72
87
|
from .automation_rule_evaluator_trace_thread_llm_as_judge import AutomationRuleEvaluatorTraceThreadLlmAsJudge
|
|
73
88
|
from .automation_rule_evaluator_trace_thread_llm_as_judge_public import (
|
|
74
89
|
AutomationRuleEvaluatorTraceThreadLlmAsJudgePublic,
|
|
@@ -87,12 +102,16 @@ from .automation_rule_evaluator_update import (
|
|
|
87
102
|
AutomationRuleEvaluatorUpdate,
|
|
88
103
|
AutomationRuleEvaluatorUpdate_LlmAsJudge,
|
|
89
104
|
AutomationRuleEvaluatorUpdate_SpanLlmAsJudge,
|
|
105
|
+
AutomationRuleEvaluatorUpdate_SpanUserDefinedMetricPython,
|
|
90
106
|
AutomationRuleEvaluatorUpdate_TraceThreadLlmAsJudge,
|
|
91
107
|
AutomationRuleEvaluatorUpdate_TraceThreadUserDefinedMetricPython,
|
|
92
108
|
AutomationRuleEvaluatorUpdate_UserDefinedMetricPython,
|
|
93
109
|
)
|
|
94
110
|
from .automation_rule_evaluator_update_llm_as_judge import AutomationRuleEvaluatorUpdateLlmAsJudge
|
|
95
111
|
from .automation_rule_evaluator_update_span_llm_as_judge import AutomationRuleEvaluatorUpdateSpanLlmAsJudge
|
|
112
|
+
from .automation_rule_evaluator_update_span_user_defined_metric_python import (
|
|
113
|
+
AutomationRuleEvaluatorUpdateSpanUserDefinedMetricPython,
|
|
114
|
+
)
|
|
96
115
|
from .automation_rule_evaluator_update_trace_thread_llm_as_judge import (
|
|
97
116
|
AutomationRuleEvaluatorUpdateTraceThreadLlmAsJudge,
|
|
98
117
|
)
|
|
@@ -113,6 +132,7 @@ from .automation_rule_evaluator_write import (
|
|
|
113
132
|
AutomationRuleEvaluatorWrite,
|
|
114
133
|
AutomationRuleEvaluatorWrite_LlmAsJudge,
|
|
115
134
|
AutomationRuleEvaluatorWrite_SpanLlmAsJudge,
|
|
135
|
+
AutomationRuleEvaluatorWrite_SpanUserDefinedMetricPython,
|
|
116
136
|
AutomationRuleEvaluatorWrite_TraceThreadLlmAsJudge,
|
|
117
137
|
AutomationRuleEvaluatorWrite_TraceThreadUserDefinedMetricPython,
|
|
118
138
|
AutomationRuleEvaluatorWrite_UserDefinedMetricPython,
|
|
@@ -172,6 +192,7 @@ from .dataset_expansion import DatasetExpansion
|
|
|
172
192
|
from .dataset_expansion_response import DatasetExpansionResponse
|
|
173
193
|
from .dataset_item import DatasetItem
|
|
174
194
|
from .dataset_item_batch import DatasetItemBatch
|
|
195
|
+
from .dataset_item_changes_public import DatasetItemChangesPublic
|
|
175
196
|
from .dataset_item_compare import DatasetItemCompare
|
|
176
197
|
from .dataset_item_compare_source import DatasetItemCompareSource
|
|
177
198
|
from .dataset_item_filter import DatasetItemFilter
|
|
@@ -369,6 +390,8 @@ from .project_metric_response_public_metric_type import ProjectMetricResponsePub
|
|
|
369
390
|
from .project_page_public import ProjectPagePublic
|
|
370
391
|
from .project_public import ProjectPublic
|
|
371
392
|
from .project_public_visibility import ProjectPublicVisibility
|
|
393
|
+
from .project_reference import ProjectReference
|
|
394
|
+
from .project_reference_public import ProjectReferencePublic
|
|
372
395
|
from .project_stat_item_object_public import (
|
|
373
396
|
ProjectStatItemObjectPublic,
|
|
374
397
|
ProjectStatItemObjectPublic_Avg,
|
|
@@ -401,6 +424,7 @@ from .prompt_version_public_template_structure import PromptVersionPublicTemplat
|
|
|
401
424
|
from .prompt_version_public_type import PromptVersionPublicType
|
|
402
425
|
from .prompt_version_template_structure import PromptVersionTemplateStructure
|
|
403
426
|
from .prompt_version_type import PromptVersionType
|
|
427
|
+
from .prompt_version_update import PromptVersionUpdate
|
|
404
428
|
from .provider_api_key import ProviderApiKey
|
|
405
429
|
from .provider_api_key_page_public import ProviderApiKeyPagePublic
|
|
406
430
|
from .provider_api_key_provider import ProviderApiKeyProvider
|
|
@@ -432,6 +456,9 @@ from .span_public_type import SpanPublicType
|
|
|
432
456
|
from .span_type import SpanType
|
|
433
457
|
from .span_update import SpanUpdate
|
|
434
458
|
from .span_update_type import SpanUpdateType
|
|
459
|
+
from .span_user_defined_metric_python_code import SpanUserDefinedMetricPythonCode
|
|
460
|
+
from .span_user_defined_metric_python_code_public import SpanUserDefinedMetricPythonCodePublic
|
|
461
|
+
from .span_user_defined_metric_python_code_write import SpanUserDefinedMetricPythonCodeWrite
|
|
435
462
|
from .span_write import SpanWrite
|
|
436
463
|
from .span_write_type import SpanWriteType
|
|
437
464
|
from .spans_count_response import SpansCountResponse
|
|
@@ -558,6 +585,9 @@ __all__ = [
|
|
|
558
585
|
"AssistantMessageRole",
|
|
559
586
|
"Attachment",
|
|
560
587
|
"AttachmentPage",
|
|
588
|
+
"AudioUrl",
|
|
589
|
+
"AudioUrlPublic",
|
|
590
|
+
"AudioUrlWrite",
|
|
561
591
|
"AuthDetailsHolder",
|
|
562
592
|
"AutomationRuleEvaluator",
|
|
563
593
|
"AutomationRuleEvaluatorLlmAsJudge",
|
|
@@ -566,6 +596,7 @@ __all__ = [
|
|
|
566
596
|
"AutomationRuleEvaluatorObjectObjectPublic",
|
|
567
597
|
"AutomationRuleEvaluatorObjectObjectPublic_LlmAsJudge",
|
|
568
598
|
"AutomationRuleEvaluatorObjectObjectPublic_SpanLlmAsJudge",
|
|
599
|
+
"AutomationRuleEvaluatorObjectObjectPublic_SpanUserDefinedMetricPython",
|
|
569
600
|
"AutomationRuleEvaluatorObjectObjectPublic_TraceThreadLlmAsJudge",
|
|
570
601
|
"AutomationRuleEvaluatorObjectObjectPublic_TraceThreadUserDefinedMetricPython",
|
|
571
602
|
"AutomationRuleEvaluatorObjectObjectPublic_UserDefinedMetricPython",
|
|
@@ -573,12 +604,16 @@ __all__ = [
|
|
|
573
604
|
"AutomationRuleEvaluatorPublic",
|
|
574
605
|
"AutomationRuleEvaluatorPublic_LlmAsJudge",
|
|
575
606
|
"AutomationRuleEvaluatorPublic_SpanLlmAsJudge",
|
|
607
|
+
"AutomationRuleEvaluatorPublic_SpanUserDefinedMetricPython",
|
|
576
608
|
"AutomationRuleEvaluatorPublic_TraceThreadLlmAsJudge",
|
|
577
609
|
"AutomationRuleEvaluatorPublic_TraceThreadUserDefinedMetricPython",
|
|
578
610
|
"AutomationRuleEvaluatorPublic_UserDefinedMetricPython",
|
|
579
611
|
"AutomationRuleEvaluatorSpanLlmAsJudge",
|
|
580
612
|
"AutomationRuleEvaluatorSpanLlmAsJudgePublic",
|
|
581
613
|
"AutomationRuleEvaluatorSpanLlmAsJudgeWrite",
|
|
614
|
+
"AutomationRuleEvaluatorSpanUserDefinedMetricPython",
|
|
615
|
+
"AutomationRuleEvaluatorSpanUserDefinedMetricPythonPublic",
|
|
616
|
+
"AutomationRuleEvaluatorSpanUserDefinedMetricPythonWrite",
|
|
582
617
|
"AutomationRuleEvaluatorTraceThreadLlmAsJudge",
|
|
583
618
|
"AutomationRuleEvaluatorTraceThreadLlmAsJudgePublic",
|
|
584
619
|
"AutomationRuleEvaluatorTraceThreadLlmAsJudgeWrite",
|
|
@@ -588,11 +623,13 @@ __all__ = [
|
|
|
588
623
|
"AutomationRuleEvaluatorUpdate",
|
|
589
624
|
"AutomationRuleEvaluatorUpdateLlmAsJudge",
|
|
590
625
|
"AutomationRuleEvaluatorUpdateSpanLlmAsJudge",
|
|
626
|
+
"AutomationRuleEvaluatorUpdateSpanUserDefinedMetricPython",
|
|
591
627
|
"AutomationRuleEvaluatorUpdateTraceThreadLlmAsJudge",
|
|
592
628
|
"AutomationRuleEvaluatorUpdateTraceThreadUserDefinedMetricPython",
|
|
593
629
|
"AutomationRuleEvaluatorUpdateUserDefinedMetricPython",
|
|
594
630
|
"AutomationRuleEvaluatorUpdate_LlmAsJudge",
|
|
595
631
|
"AutomationRuleEvaluatorUpdate_SpanLlmAsJudge",
|
|
632
|
+
"AutomationRuleEvaluatorUpdate_SpanUserDefinedMetricPython",
|
|
596
633
|
"AutomationRuleEvaluatorUpdate_TraceThreadLlmAsJudge",
|
|
597
634
|
"AutomationRuleEvaluatorUpdate_TraceThreadUserDefinedMetricPython",
|
|
598
635
|
"AutomationRuleEvaluatorUpdate_UserDefinedMetricPython",
|
|
@@ -602,11 +639,13 @@ __all__ = [
|
|
|
602
639
|
"AutomationRuleEvaluatorWrite",
|
|
603
640
|
"AutomationRuleEvaluatorWrite_LlmAsJudge",
|
|
604
641
|
"AutomationRuleEvaluatorWrite_SpanLlmAsJudge",
|
|
642
|
+
"AutomationRuleEvaluatorWrite_SpanUserDefinedMetricPython",
|
|
605
643
|
"AutomationRuleEvaluatorWrite_TraceThreadLlmAsJudge",
|
|
606
644
|
"AutomationRuleEvaluatorWrite_TraceThreadUserDefinedMetricPython",
|
|
607
645
|
"AutomationRuleEvaluatorWrite_UserDefinedMetricPython",
|
|
608
646
|
"AutomationRuleEvaluator_LlmAsJudge",
|
|
609
647
|
"AutomationRuleEvaluator_SpanLlmAsJudge",
|
|
648
|
+
"AutomationRuleEvaluator_SpanUserDefinedMetricPython",
|
|
610
649
|
"AutomationRuleEvaluator_TraceThreadLlmAsJudge",
|
|
611
650
|
"AutomationRuleEvaluator_TraceThreadUserDefinedMetricPython",
|
|
612
651
|
"AutomationRuleEvaluator_UserDefinedMetricPython",
|
|
@@ -665,6 +704,7 @@ __all__ = [
|
|
|
665
704
|
"DatasetExpansionResponse",
|
|
666
705
|
"DatasetItem",
|
|
667
706
|
"DatasetItemBatch",
|
|
707
|
+
"DatasetItemChangesPublic",
|
|
668
708
|
"DatasetItemCompare",
|
|
669
709
|
"DatasetItemCompareSource",
|
|
670
710
|
"DatasetItemFilter",
|
|
@@ -855,6 +895,8 @@ __all__ = [
|
|
|
855
895
|
"ProjectPagePublic",
|
|
856
896
|
"ProjectPublic",
|
|
857
897
|
"ProjectPublicVisibility",
|
|
898
|
+
"ProjectReference",
|
|
899
|
+
"ProjectReferencePublic",
|
|
858
900
|
"ProjectStatItemObjectPublic",
|
|
859
901
|
"ProjectStatItemObjectPublic_Avg",
|
|
860
902
|
"ProjectStatItemObjectPublic_Count",
|
|
@@ -885,6 +927,7 @@ __all__ = [
|
|
|
885
927
|
"PromptVersionPublicType",
|
|
886
928
|
"PromptVersionTemplateStructure",
|
|
887
929
|
"PromptVersionType",
|
|
930
|
+
"PromptVersionUpdate",
|
|
888
931
|
"ProviderApiKey",
|
|
889
932
|
"ProviderApiKeyPagePublic",
|
|
890
933
|
"ProviderApiKeyProvider",
|
|
@@ -916,6 +959,9 @@ __all__ = [
|
|
|
916
959
|
"SpanType",
|
|
917
960
|
"SpanUpdate",
|
|
918
961
|
"SpanUpdateType",
|
|
962
|
+
"SpanUserDefinedMetricPythonCode",
|
|
963
|
+
"SpanUserDefinedMetricPythonCodePublic",
|
|
964
|
+
"SpanUserDefinedMetricPythonCodeWrite",
|
|
919
965
|
"SpanWrite",
|
|
920
966
|
"SpanWriteType",
|
|
921
967
|
"SpansCountResponse",
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
|
|
3
|
+
import typing
|
|
4
|
+
|
|
5
|
+
import pydantic
|
|
6
|
+
from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
class AudioUrl(UniversalBaseModel):
|
|
10
|
+
url: str
|
|
11
|
+
|
|
12
|
+
if IS_PYDANTIC_V2:
|
|
13
|
+
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
|
|
14
|
+
else:
|
|
15
|
+
|
|
16
|
+
class Config:
|
|
17
|
+
frozen = True
|
|
18
|
+
smart_union = True
|
|
19
|
+
extra = pydantic.Extra.allow
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
|
|
3
|
+
import typing
|
|
4
|
+
|
|
5
|
+
import pydantic
|
|
6
|
+
from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
class AudioUrlPublic(UniversalBaseModel):
|
|
10
|
+
url: str
|
|
11
|
+
|
|
12
|
+
if IS_PYDANTIC_V2:
|
|
13
|
+
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
|
|
14
|
+
else:
|
|
15
|
+
|
|
16
|
+
class Config:
|
|
17
|
+
frozen = True
|
|
18
|
+
smart_union = True
|
|
19
|
+
extra = pydantic.Extra.allow
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
|
|
3
|
+
import typing
|
|
4
|
+
|
|
5
|
+
import pydantic
|
|
6
|
+
from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
class AudioUrlWrite(UniversalBaseModel):
|
|
10
|
+
url: str
|
|
11
|
+
|
|
12
|
+
if IS_PYDANTIC_V2:
|
|
13
|
+
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
|
|
14
|
+
else:
|
|
15
|
+
|
|
16
|
+
class Config:
|
|
17
|
+
frozen = True
|
|
18
|
+
smart_union = True
|
|
19
|
+
extra = pydantic.Extra.allow
|
|
@@ -8,8 +8,10 @@ import typing
|
|
|
8
8
|
import pydantic
|
|
9
9
|
from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
|
|
10
10
|
from .llm_as_judge_code import LlmAsJudgeCode
|
|
11
|
+
from .project_reference import ProjectReference
|
|
11
12
|
from .span_filter import SpanFilter
|
|
12
13
|
from .span_llm_as_judge_code import SpanLlmAsJudgeCode
|
|
14
|
+
from .span_user_defined_metric_python_code import SpanUserDefinedMetricPythonCode
|
|
13
15
|
from .trace_filter import TraceFilter
|
|
14
16
|
from .trace_thread_filter import TraceThreadFilter
|
|
15
17
|
from .trace_thread_llm_as_judge_code import TraceThreadLlmAsJudgeCode
|
|
@@ -19,8 +21,26 @@ from .user_defined_metric_python_code import UserDefinedMetricPythonCode
|
|
|
19
21
|
|
|
20
22
|
class Base(UniversalBaseModel):
|
|
21
23
|
id: typing.Optional[str] = None
|
|
22
|
-
project_id: str
|
|
23
|
-
|
|
24
|
+
project_id: typing.Optional[str] = pydantic.Field(default=None)
|
|
25
|
+
"""
|
|
26
|
+
Primary project ID (legacy field for backwards compatibility)
|
|
27
|
+
"""
|
|
28
|
+
|
|
29
|
+
project_name: typing.Optional[str] = pydantic.Field(default=None)
|
|
30
|
+
"""
|
|
31
|
+
Primary project name (legacy field for backwards compatibility)
|
|
32
|
+
"""
|
|
33
|
+
|
|
34
|
+
projects: typing.Optional[typing.List[ProjectReference]] = pydantic.Field(default=None)
|
|
35
|
+
"""
|
|
36
|
+
Projects assigned to this rule (unique, sorted alphabetically by name)
|
|
37
|
+
"""
|
|
38
|
+
|
|
39
|
+
project_ids: typing.Optional[typing.List[str]] = pydantic.Field(default=None)
|
|
40
|
+
"""
|
|
41
|
+
Project IDs for write operations (used when creating/updating rules)
|
|
42
|
+
"""
|
|
43
|
+
|
|
24
44
|
name: str
|
|
25
45
|
sampling_rate: typing.Optional[float] = None
|
|
26
46
|
enabled: typing.Optional[bool] = None
|
|
@@ -115,10 +135,26 @@ class AutomationRuleEvaluator_SpanLlmAsJudge(Base):
|
|
|
115
135
|
extra = pydantic.Extra.allow
|
|
116
136
|
|
|
117
137
|
|
|
138
|
+
class AutomationRuleEvaluator_SpanUserDefinedMetricPython(Base):
|
|
139
|
+
type: typing.Literal["span_user_defined_metric_python"] = "span_user_defined_metric_python"
|
|
140
|
+
filters: typing.Optional[typing.List[SpanFilter]] = None
|
|
141
|
+
code: typing.Optional[SpanUserDefinedMetricPythonCode] = None
|
|
142
|
+
|
|
143
|
+
if IS_PYDANTIC_V2:
|
|
144
|
+
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
|
|
145
|
+
else:
|
|
146
|
+
|
|
147
|
+
class Config:
|
|
148
|
+
frozen = True
|
|
149
|
+
smart_union = True
|
|
150
|
+
extra = pydantic.Extra.allow
|
|
151
|
+
|
|
152
|
+
|
|
118
153
|
AutomationRuleEvaluator = typing.Union[
|
|
119
154
|
AutomationRuleEvaluator_LlmAsJudge,
|
|
120
155
|
AutomationRuleEvaluator_UserDefinedMetricPython,
|
|
121
156
|
AutomationRuleEvaluator_TraceThreadLlmAsJudge,
|
|
122
157
|
AutomationRuleEvaluator_TraceThreadUserDefinedMetricPython,
|
|
123
158
|
AutomationRuleEvaluator_SpanLlmAsJudge,
|
|
159
|
+
AutomationRuleEvaluator_SpanUserDefinedMetricPython,
|
|
124
160
|
]
|
|
@@ -8,8 +8,10 @@ import typing
|
|
|
8
8
|
import pydantic
|
|
9
9
|
from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
|
|
10
10
|
from .llm_as_judge_code_public import LlmAsJudgeCodePublic
|
|
11
|
+
from .project_reference_public import ProjectReferencePublic
|
|
11
12
|
from .span_filter_public import SpanFilterPublic
|
|
12
13
|
from .span_llm_as_judge_code_public import SpanLlmAsJudgeCodePublic
|
|
14
|
+
from .span_user_defined_metric_python_code_public import SpanUserDefinedMetricPythonCodePublic
|
|
13
15
|
from .trace_filter_public import TraceFilterPublic
|
|
14
16
|
from .trace_thread_filter_public import TraceThreadFilterPublic
|
|
15
17
|
from .trace_thread_llm_as_judge_code_public import TraceThreadLlmAsJudgeCodePublic
|
|
@@ -19,8 +21,21 @@ from .user_defined_metric_python_code_public import UserDefinedMetricPythonCodeP
|
|
|
19
21
|
|
|
20
22
|
class Base(UniversalBaseModel):
|
|
21
23
|
id: typing.Optional[str] = None
|
|
22
|
-
project_id: str
|
|
23
|
-
|
|
24
|
+
project_id: typing.Optional[str] = pydantic.Field(default=None)
|
|
25
|
+
"""
|
|
26
|
+
Primary project ID (legacy field for backwards compatibility)
|
|
27
|
+
"""
|
|
28
|
+
|
|
29
|
+
project_name: typing.Optional[str] = pydantic.Field(default=None)
|
|
30
|
+
"""
|
|
31
|
+
Primary project name (legacy field for backwards compatibility)
|
|
32
|
+
"""
|
|
33
|
+
|
|
34
|
+
projects: typing.Optional[typing.List[ProjectReferencePublic]] = pydantic.Field(default=None)
|
|
35
|
+
"""
|
|
36
|
+
Projects assigned to this rule (unique, sorted alphabetically by name)
|
|
37
|
+
"""
|
|
38
|
+
|
|
24
39
|
name: str
|
|
25
40
|
sampling_rate: typing.Optional[float] = None
|
|
26
41
|
enabled: typing.Optional[bool] = None
|
|
@@ -115,10 +130,26 @@ class AutomationRuleEvaluatorObjectObjectPublic_SpanLlmAsJudge(Base):
|
|
|
115
130
|
extra = pydantic.Extra.allow
|
|
116
131
|
|
|
117
132
|
|
|
133
|
+
class AutomationRuleEvaluatorObjectObjectPublic_SpanUserDefinedMetricPython(Base):
|
|
134
|
+
type: typing.Literal["span_user_defined_metric_python"] = "span_user_defined_metric_python"
|
|
135
|
+
filters: typing.Optional[typing.List[SpanFilterPublic]] = None
|
|
136
|
+
code: typing.Optional[SpanUserDefinedMetricPythonCodePublic] = None
|
|
137
|
+
|
|
138
|
+
if IS_PYDANTIC_V2:
|
|
139
|
+
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
|
|
140
|
+
else:
|
|
141
|
+
|
|
142
|
+
class Config:
|
|
143
|
+
frozen = True
|
|
144
|
+
smart_union = True
|
|
145
|
+
extra = pydantic.Extra.allow
|
|
146
|
+
|
|
147
|
+
|
|
118
148
|
AutomationRuleEvaluatorObjectObjectPublic = typing.Union[
|
|
119
149
|
AutomationRuleEvaluatorObjectObjectPublic_LlmAsJudge,
|
|
120
150
|
AutomationRuleEvaluatorObjectObjectPublic_UserDefinedMetricPython,
|
|
121
151
|
AutomationRuleEvaluatorObjectObjectPublic_TraceThreadLlmAsJudge,
|
|
122
152
|
AutomationRuleEvaluatorObjectObjectPublic_TraceThreadUserDefinedMetricPython,
|
|
123
153
|
AutomationRuleEvaluatorObjectObjectPublic_SpanLlmAsJudge,
|
|
154
|
+
AutomationRuleEvaluatorObjectObjectPublic_SpanUserDefinedMetricPython,
|
|
124
155
|
]
|
|
@@ -8,8 +8,10 @@ import typing
|
|
|
8
8
|
import pydantic
|
|
9
9
|
from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
|
|
10
10
|
from .llm_as_judge_code_public import LlmAsJudgeCodePublic
|
|
11
|
+
from .project_reference_public import ProjectReferencePublic
|
|
11
12
|
from .span_filter_public import SpanFilterPublic
|
|
12
13
|
from .span_llm_as_judge_code_public import SpanLlmAsJudgeCodePublic
|
|
14
|
+
from .span_user_defined_metric_python_code_public import SpanUserDefinedMetricPythonCodePublic
|
|
13
15
|
from .trace_filter_public import TraceFilterPublic
|
|
14
16
|
from .trace_thread_filter_public import TraceThreadFilterPublic
|
|
15
17
|
from .trace_thread_llm_as_judge_code_public import TraceThreadLlmAsJudgeCodePublic
|
|
@@ -19,8 +21,21 @@ from .user_defined_metric_python_code_public import UserDefinedMetricPythonCodeP
|
|
|
19
21
|
|
|
20
22
|
class Base(UniversalBaseModel):
|
|
21
23
|
id: typing.Optional[str] = None
|
|
22
|
-
project_id: str
|
|
23
|
-
|
|
24
|
+
project_id: typing.Optional[str] = pydantic.Field(default=None)
|
|
25
|
+
"""
|
|
26
|
+
Primary project ID (legacy field for backwards compatibility)
|
|
27
|
+
"""
|
|
28
|
+
|
|
29
|
+
project_name: typing.Optional[str] = pydantic.Field(default=None)
|
|
30
|
+
"""
|
|
31
|
+
Primary project name (legacy field for backwards compatibility)
|
|
32
|
+
"""
|
|
33
|
+
|
|
34
|
+
projects: typing.Optional[typing.List[ProjectReferencePublic]] = pydantic.Field(default=None)
|
|
35
|
+
"""
|
|
36
|
+
Projects assigned to this rule (unique, sorted alphabetically by name)
|
|
37
|
+
"""
|
|
38
|
+
|
|
24
39
|
name: str
|
|
25
40
|
sampling_rate: typing.Optional[float] = None
|
|
26
41
|
enabled: typing.Optional[bool] = None
|
|
@@ -115,10 +130,26 @@ class AutomationRuleEvaluatorPublic_SpanLlmAsJudge(Base):
|
|
|
115
130
|
extra = pydantic.Extra.allow
|
|
116
131
|
|
|
117
132
|
|
|
133
|
+
class AutomationRuleEvaluatorPublic_SpanUserDefinedMetricPython(Base):
|
|
134
|
+
type: typing.Literal["span_user_defined_metric_python"] = "span_user_defined_metric_python"
|
|
135
|
+
filters: typing.Optional[typing.List[SpanFilterPublic]] = None
|
|
136
|
+
code: typing.Optional[SpanUserDefinedMetricPythonCodePublic] = None
|
|
137
|
+
|
|
138
|
+
if IS_PYDANTIC_V2:
|
|
139
|
+
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
|
|
140
|
+
else:
|
|
141
|
+
|
|
142
|
+
class Config:
|
|
143
|
+
frozen = True
|
|
144
|
+
smart_union = True
|
|
145
|
+
extra = pydantic.Extra.allow
|
|
146
|
+
|
|
147
|
+
|
|
118
148
|
AutomationRuleEvaluatorPublic = typing.Union[
|
|
119
149
|
AutomationRuleEvaluatorPublic_LlmAsJudge,
|
|
120
150
|
AutomationRuleEvaluatorPublic_UserDefinedMetricPython,
|
|
121
151
|
AutomationRuleEvaluatorPublic_TraceThreadLlmAsJudge,
|
|
122
152
|
AutomationRuleEvaluatorPublic_TraceThreadUserDefinedMetricPython,
|
|
123
153
|
AutomationRuleEvaluatorPublic_SpanLlmAsJudge,
|
|
154
|
+
AutomationRuleEvaluatorPublic_SpanUserDefinedMetricPython,
|
|
124
155
|
]
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
|
|
3
|
+
import typing
|
|
4
|
+
|
|
5
|
+
import pydantic
|
|
6
|
+
from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
|
|
7
|
+
from .span_filter import SpanFilter
|
|
8
|
+
from .span_user_defined_metric_python_code import SpanUserDefinedMetricPythonCode
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
class AutomationRuleEvaluatorSpanUserDefinedMetricPython(UniversalBaseModel):
|
|
12
|
+
filters: typing.Optional[typing.List[SpanFilter]] = None
|
|
13
|
+
code: typing.Optional[SpanUserDefinedMetricPythonCode] = None
|
|
14
|
+
|
|
15
|
+
if IS_PYDANTIC_V2:
|
|
16
|
+
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
|
|
17
|
+
else:
|
|
18
|
+
|
|
19
|
+
class Config:
|
|
20
|
+
frozen = True
|
|
21
|
+
smart_union = True
|
|
22
|
+
extra = pydantic.Extra.allow
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
|
|
3
|
+
import typing
|
|
4
|
+
|
|
5
|
+
import pydantic
|
|
6
|
+
from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
|
|
7
|
+
from .span_filter_public import SpanFilterPublic
|
|
8
|
+
from .span_user_defined_metric_python_code_public import SpanUserDefinedMetricPythonCodePublic
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
class AutomationRuleEvaluatorSpanUserDefinedMetricPythonPublic(UniversalBaseModel):
|
|
12
|
+
filters: typing.Optional[typing.List[SpanFilterPublic]] = None
|
|
13
|
+
code: typing.Optional[SpanUserDefinedMetricPythonCodePublic] = None
|
|
14
|
+
|
|
15
|
+
if IS_PYDANTIC_V2:
|
|
16
|
+
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
|
|
17
|
+
else:
|
|
18
|
+
|
|
19
|
+
class Config:
|
|
20
|
+
frozen = True
|
|
21
|
+
smart_union = True
|
|
22
|
+
extra = pydantic.Extra.allow
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
|
|
3
|
+
import typing
|
|
4
|
+
|
|
5
|
+
import pydantic
|
|
6
|
+
from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
|
|
7
|
+
from .span_filter_write import SpanFilterWrite
|
|
8
|
+
from .span_user_defined_metric_python_code_write import SpanUserDefinedMetricPythonCodeWrite
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
class AutomationRuleEvaluatorSpanUserDefinedMetricPythonWrite(UniversalBaseModel):
|
|
12
|
+
filters: typing.Optional[typing.List[SpanFilterWrite]] = None
|
|
13
|
+
code: typing.Optional[SpanUserDefinedMetricPythonCodeWrite] = None
|
|
14
|
+
|
|
15
|
+
if IS_PYDANTIC_V2:
|
|
16
|
+
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
|
|
17
|
+
else:
|
|
18
|
+
|
|
19
|
+
class Config:
|
|
20
|
+
frozen = True
|
|
21
|
+
smart_union = True
|
|
22
|
+
extra = pydantic.Extra.allow
|
|
@@ -9,6 +9,7 @@ from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
|
|
|
9
9
|
from .llm_as_judge_code import LlmAsJudgeCode
|
|
10
10
|
from .span_filter import SpanFilter
|
|
11
11
|
from .span_llm_as_judge_code import SpanLlmAsJudgeCode
|
|
12
|
+
from .span_user_defined_metric_python_code import SpanUserDefinedMetricPythonCode
|
|
12
13
|
from .trace_filter import TraceFilter
|
|
13
14
|
from .trace_thread_filter import TraceThreadFilter
|
|
14
15
|
from .trace_thread_llm_as_judge_code import TraceThreadLlmAsJudgeCode
|
|
@@ -20,7 +21,16 @@ class Base(UniversalBaseModel):
|
|
|
20
21
|
name: str
|
|
21
22
|
sampling_rate: typing.Optional[float] = None
|
|
22
23
|
enabled: typing.Optional[bool] = None
|
|
23
|
-
project_id: str
|
|
24
|
+
project_id: typing.Optional[str] = pydantic.Field(default=None)
|
|
25
|
+
"""
|
|
26
|
+
Primary project ID (legacy field, maintained for backwards compatibility)
|
|
27
|
+
"""
|
|
28
|
+
|
|
29
|
+
project_ids: typing.Optional[typing.List[str]] = pydantic.Field(default=None)
|
|
30
|
+
"""
|
|
31
|
+
Multiple project IDs (new field for multi-project support)
|
|
32
|
+
"""
|
|
33
|
+
|
|
24
34
|
action: typing.Literal["evaluator"] = "evaluator"
|
|
25
35
|
|
|
26
36
|
if IS_PYDANTIC_V2:
|
|
@@ -108,10 +118,26 @@ class AutomationRuleEvaluatorUpdate_SpanLlmAsJudge(Base):
|
|
|
108
118
|
extra = pydantic.Extra.allow
|
|
109
119
|
|
|
110
120
|
|
|
121
|
+
class AutomationRuleEvaluatorUpdate_SpanUserDefinedMetricPython(Base):
|
|
122
|
+
type: typing.Literal["span_user_defined_metric_python"] = "span_user_defined_metric_python"
|
|
123
|
+
filters: typing.Optional[typing.List[SpanFilter]] = None
|
|
124
|
+
code: typing.Optional[SpanUserDefinedMetricPythonCode] = None
|
|
125
|
+
|
|
126
|
+
if IS_PYDANTIC_V2:
|
|
127
|
+
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
|
|
128
|
+
else:
|
|
129
|
+
|
|
130
|
+
class Config:
|
|
131
|
+
frozen = True
|
|
132
|
+
smart_union = True
|
|
133
|
+
extra = pydantic.Extra.allow
|
|
134
|
+
|
|
135
|
+
|
|
111
136
|
AutomationRuleEvaluatorUpdate = typing.Union[
|
|
112
137
|
AutomationRuleEvaluatorUpdate_LlmAsJudge,
|
|
113
138
|
AutomationRuleEvaluatorUpdate_UserDefinedMetricPython,
|
|
114
139
|
AutomationRuleEvaluatorUpdate_TraceThreadLlmAsJudge,
|
|
115
140
|
AutomationRuleEvaluatorUpdate_TraceThreadUserDefinedMetricPython,
|
|
116
141
|
AutomationRuleEvaluatorUpdate_SpanLlmAsJudge,
|
|
142
|
+
AutomationRuleEvaluatorUpdate_SpanUserDefinedMetricPython,
|
|
117
143
|
]
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
|
|
3
|
+
import typing
|
|
4
|
+
|
|
5
|
+
import pydantic
|
|
6
|
+
from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
|
|
7
|
+
from .span_filter import SpanFilter
|
|
8
|
+
from .span_user_defined_metric_python_code import SpanUserDefinedMetricPythonCode
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
class AutomationRuleEvaluatorUpdateSpanUserDefinedMetricPython(UniversalBaseModel):
|
|
12
|
+
filters: typing.Optional[typing.List[SpanFilter]] = None
|
|
13
|
+
code: typing.Optional[SpanUserDefinedMetricPythonCode] = None
|
|
14
|
+
|
|
15
|
+
if IS_PYDANTIC_V2:
|
|
16
|
+
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
|
|
17
|
+
else:
|
|
18
|
+
|
|
19
|
+
class Config:
|
|
20
|
+
frozen = True
|
|
21
|
+
smart_union = True
|
|
22
|
+
extra = pydantic.Extra.allow
|
|
@@ -9,6 +9,7 @@ from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
|
|
|
9
9
|
from .llm_as_judge_code_write import LlmAsJudgeCodeWrite
|
|
10
10
|
from .span_filter_write import SpanFilterWrite
|
|
11
11
|
from .span_llm_as_judge_code_write import SpanLlmAsJudgeCodeWrite
|
|
12
|
+
from .span_user_defined_metric_python_code_write import SpanUserDefinedMetricPythonCodeWrite
|
|
12
13
|
from .trace_filter_write import TraceFilterWrite
|
|
13
14
|
from .trace_thread_filter_write import TraceThreadFilterWrite
|
|
14
15
|
from .trace_thread_llm_as_judge_code_write import TraceThreadLlmAsJudgeCodeWrite
|
|
@@ -17,7 +18,16 @@ from .user_defined_metric_python_code_write import UserDefinedMetricPythonCodeWr
|
|
|
17
18
|
|
|
18
19
|
|
|
19
20
|
class Base(UniversalBaseModel):
|
|
20
|
-
project_id: str
|
|
21
|
+
project_id: typing.Optional[str] = pydantic.Field(default=None)
|
|
22
|
+
"""
|
|
23
|
+
Primary project ID (legacy field for backwards compatibility)
|
|
24
|
+
"""
|
|
25
|
+
|
|
26
|
+
project_ids: typing.Optional[typing.List[str]] = pydantic.Field(default=None)
|
|
27
|
+
"""
|
|
28
|
+
Project IDs for write operations (used when creating/updating rules)
|
|
29
|
+
"""
|
|
30
|
+
|
|
21
31
|
name: str
|
|
22
32
|
sampling_rate: typing.Optional[float] = None
|
|
23
33
|
enabled: typing.Optional[bool] = None
|
|
@@ -108,10 +118,26 @@ class AutomationRuleEvaluatorWrite_SpanLlmAsJudge(Base):
|
|
|
108
118
|
extra = pydantic.Extra.allow
|
|
109
119
|
|
|
110
120
|
|
|
121
|
+
class AutomationRuleEvaluatorWrite_SpanUserDefinedMetricPython(Base):
|
|
122
|
+
type: typing.Literal["span_user_defined_metric_python"] = "span_user_defined_metric_python"
|
|
123
|
+
filters: typing.Optional[typing.List[SpanFilterWrite]] = None
|
|
124
|
+
code: typing.Optional[SpanUserDefinedMetricPythonCodeWrite] = None
|
|
125
|
+
|
|
126
|
+
if IS_PYDANTIC_V2:
|
|
127
|
+
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
|
|
128
|
+
else:
|
|
129
|
+
|
|
130
|
+
class Config:
|
|
131
|
+
frozen = True
|
|
132
|
+
smart_union = True
|
|
133
|
+
extra = pydantic.Extra.allow
|
|
134
|
+
|
|
135
|
+
|
|
111
136
|
AutomationRuleEvaluatorWrite = typing.Union[
|
|
112
137
|
AutomationRuleEvaluatorWrite_LlmAsJudge,
|
|
113
138
|
AutomationRuleEvaluatorWrite_UserDefinedMetricPython,
|
|
114
139
|
AutomationRuleEvaluatorWrite_TraceThreadLlmAsJudge,
|
|
115
140
|
AutomationRuleEvaluatorWrite_TraceThreadUserDefinedMetricPython,
|
|
116
141
|
AutomationRuleEvaluatorWrite_SpanLlmAsJudge,
|
|
142
|
+
AutomationRuleEvaluatorWrite_SpanUserDefinedMetricPython,
|
|
117
143
|
]
|
|
@@ -12,7 +12,7 @@ from .json_node import JsonNode
|
|
|
12
12
|
|
|
13
13
|
class DatasetItem(UniversalBaseModel):
|
|
14
14
|
id: typing.Optional[str] = None
|
|
15
|
-
|
|
15
|
+
dataset_item_id: typing.Optional[str] = None
|
|
16
16
|
trace_id: typing.Optional[str] = None
|
|
17
17
|
span_id: typing.Optional[str] = None
|
|
18
18
|
source: DatasetItemSource
|
|
@@ -19,6 +19,10 @@ class DatasetItemBatch(UniversalBaseModel):
|
|
|
19
19
|
"""
|
|
20
20
|
|
|
21
21
|
items: typing.List[DatasetItem]
|
|
22
|
+
batch_group_id: typing.Optional[str] = pydantic.Field(default=None)
|
|
23
|
+
"""
|
|
24
|
+
Optional batch group ID to group multiple batches into a single dataset version. If null, mutates the latest version instead of creating a new one.
|
|
25
|
+
"""
|
|
22
26
|
|
|
23
27
|
if IS_PYDANTIC_V2:
|
|
24
28
|
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
|