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.
- opik/__init__.py +10 -3
- opik/anonymizer/__init__.py +5 -0
- opik/anonymizer/anonymizer.py +12 -0
- opik/anonymizer/factory.py +80 -0
- opik/anonymizer/recursive_anonymizer.py +64 -0
- opik/anonymizer/rules.py +56 -0
- opik/anonymizer/rules_anonymizer.py +35 -0
- opik/api_objects/dataset/rest_operations.py +5 -0
- opik/api_objects/experiment/experiment.py +46 -49
- opik/api_objects/experiment/helpers.py +34 -10
- opik/api_objects/local_recording.py +8 -3
- opik/api_objects/opik_client.py +230 -48
- opik/api_objects/opik_query_language.py +9 -0
- opik/api_objects/prompt/__init__.py +11 -3
- opik/api_objects/prompt/base_prompt.py +69 -0
- opik/api_objects/prompt/base_prompt_template.py +29 -0
- opik/api_objects/prompt/chat/__init__.py +1 -0
- opik/api_objects/prompt/chat/chat_prompt.py +193 -0
- opik/api_objects/prompt/chat/chat_prompt_template.py +350 -0
- opik/api_objects/prompt/{chat_content_renderer_registry.py → chat/content_renderer_registry.py} +37 -35
- opik/api_objects/prompt/client.py +101 -30
- opik/api_objects/prompt/text/__init__.py +1 -0
- opik/api_objects/prompt/text/prompt.py +174 -0
- opik/api_objects/prompt/{prompt_template.py → text/prompt_template.py} +10 -6
- opik/api_objects/prompt/types.py +1 -1
- opik/cli/export.py +6 -2
- opik/cli/usage_report/charts.py +39 -10
- opik/cli/usage_report/cli.py +164 -45
- opik/cli/usage_report/pdf.py +14 -1
- opik/config.py +0 -5
- opik/decorator/base_track_decorator.py +37 -40
- opik/decorator/context_manager/span_context_manager.py +9 -0
- opik/decorator/context_manager/trace_context_manager.py +5 -0
- opik/dict_utils.py +3 -3
- opik/evaluation/__init__.py +13 -2
- opik/evaluation/engine/engine.py +195 -223
- opik/evaluation/engine/helpers.py +8 -7
- opik/evaluation/engine/metrics_evaluator.py +237 -0
- opik/evaluation/evaluation_result.py +35 -1
- opik/evaluation/evaluator.py +318 -30
- opik/evaluation/models/litellm/util.py +78 -6
- opik/evaluation/models/model_capabilities.py +33 -0
- opik/evaluation/report.py +14 -2
- opik/evaluation/rest_operations.py +36 -33
- opik/evaluation/test_case.py +2 -2
- opik/evaluation/types.py +9 -1
- opik/exceptions.py +17 -0
- opik/hooks/__init__.py +17 -1
- opik/hooks/anonymizer_hook.py +36 -0
- opik/id_helpers.py +18 -0
- opik/integrations/adk/helpers.py +16 -7
- opik/integrations/adk/legacy_opik_tracer.py +7 -4
- opik/integrations/adk/opik_tracer.py +3 -1
- opik/integrations/adk/patchers/adk_otel_tracer/opik_adk_otel_tracer.py +7 -3
- opik/integrations/adk/recursive_callback_injector.py +1 -6
- opik/integrations/dspy/callback.py +1 -4
- opik/integrations/haystack/opik_connector.py +2 -2
- opik/integrations/haystack/opik_tracer.py +2 -4
- opik/integrations/langchain/opik_tracer.py +273 -82
- opik/integrations/llama_index/callback.py +110 -108
- opik/integrations/openai/agents/opik_tracing_processor.py +1 -2
- opik/integrations/openai/opik_tracker.py +1 -1
- opik/message_processing/batching/batchers.py +11 -7
- opik/message_processing/encoder_helpers.py +79 -0
- opik/message_processing/messages.py +25 -1
- opik/message_processing/online_message_processor.py +23 -8
- opik/opik_context.py +7 -7
- opik/rest_api/__init__.py +188 -12
- opik/rest_api/client.py +3 -0
- opik/rest_api/dashboards/__init__.py +4 -0
- opik/rest_api/dashboards/client.py +462 -0
- opik/rest_api/dashboards/raw_client.py +648 -0
- opik/rest_api/datasets/client.py +893 -89
- opik/rest_api/datasets/raw_client.py +1328 -87
- opik/rest_api/experiments/client.py +30 -2
- opik/rest_api/experiments/raw_client.py +26 -0
- opik/rest_api/feedback_definitions/types/find_feedback_definitions_request_type.py +1 -1
- opik/rest_api/optimizations/client.py +302 -0
- opik/rest_api/optimizations/raw_client.py +463 -0
- opik/rest_api/optimizations/types/optimization_update_status.py +3 -1
- opik/rest_api/prompts/__init__.py +2 -2
- opik/rest_api/prompts/client.py +34 -4
- opik/rest_api/prompts/raw_client.py +32 -2
- opik/rest_api/prompts/types/__init__.py +3 -1
- opik/rest_api/prompts/types/create_prompt_version_detail_template_structure.py +5 -0
- opik/rest_api/prompts/types/prompt_write_template_structure.py +5 -0
- opik/rest_api/spans/__init__.py +0 -2
- opik/rest_api/spans/client.py +148 -64
- opik/rest_api/spans/raw_client.py +210 -83
- opik/rest_api/spans/types/__init__.py +0 -2
- opik/rest_api/traces/client.py +241 -73
- opik/rest_api/traces/raw_client.py +344 -90
- opik/rest_api/types/__init__.py +200 -15
- opik/rest_api/types/aggregation_data.py +1 -0
- opik/rest_api/types/alert_trigger_config_public_type.py +6 -1
- opik/rest_api/types/alert_trigger_config_type.py +6 -1
- opik/rest_api/types/alert_trigger_config_write_type.py +6 -1
- opik/rest_api/types/automation_rule_evaluator.py +23 -1
- opik/rest_api/types/automation_rule_evaluator_llm_as_judge.py +2 -0
- opik/rest_api/types/automation_rule_evaluator_llm_as_judge_public.py +2 -0
- opik/rest_api/types/automation_rule_evaluator_llm_as_judge_write.py +2 -0
- opik/rest_api/types/{automation_rule_evaluator_object_public.py → automation_rule_evaluator_object_object_public.py} +32 -10
- opik/rest_api/types/automation_rule_evaluator_page_public.py +2 -2
- opik/rest_api/types/automation_rule_evaluator_public.py +23 -1
- opik/rest_api/types/automation_rule_evaluator_span_llm_as_judge.py +22 -0
- opik/rest_api/types/automation_rule_evaluator_span_llm_as_judge_public.py +22 -0
- opik/rest_api/types/automation_rule_evaluator_span_llm_as_judge_write.py +22 -0
- opik/rest_api/types/automation_rule_evaluator_trace_thread_llm_as_judge.py +2 -0
- opik/rest_api/types/automation_rule_evaluator_trace_thread_llm_as_judge_public.py +2 -0
- opik/rest_api/types/automation_rule_evaluator_trace_thread_llm_as_judge_write.py +2 -0
- opik/rest_api/types/automation_rule_evaluator_trace_thread_user_defined_metric_python.py +2 -0
- opik/rest_api/types/automation_rule_evaluator_trace_thread_user_defined_metric_python_public.py +2 -0
- opik/rest_api/types/automation_rule_evaluator_trace_thread_user_defined_metric_python_write.py +2 -0
- opik/rest_api/types/automation_rule_evaluator_update.py +23 -1
- opik/rest_api/types/automation_rule_evaluator_update_llm_as_judge.py +2 -0
- opik/rest_api/types/automation_rule_evaluator_update_span_llm_as_judge.py +22 -0
- opik/rest_api/types/automation_rule_evaluator_update_trace_thread_llm_as_judge.py +2 -0
- opik/rest_api/types/automation_rule_evaluator_update_trace_thread_user_defined_metric_python.py +2 -0
- opik/rest_api/types/automation_rule_evaluator_update_user_defined_metric_python.py +2 -0
- opik/rest_api/types/automation_rule_evaluator_user_defined_metric_python.py +2 -0
- opik/rest_api/types/automation_rule_evaluator_user_defined_metric_python_public.py +2 -0
- opik/rest_api/types/automation_rule_evaluator_user_defined_metric_python_write.py +2 -0
- opik/rest_api/types/automation_rule_evaluator_write.py +23 -1
- opik/rest_api/types/boolean_feedback_definition.py +25 -0
- opik/rest_api/types/boolean_feedback_definition_create.py +20 -0
- opik/rest_api/types/boolean_feedback_definition_public.py +25 -0
- opik/rest_api/types/boolean_feedback_definition_update.py +20 -0
- opik/rest_api/types/boolean_feedback_detail.py +29 -0
- opik/rest_api/types/boolean_feedback_detail_create.py +29 -0
- opik/rest_api/types/boolean_feedback_detail_public.py +29 -0
- opik/rest_api/types/boolean_feedback_detail_update.py +29 -0
- opik/rest_api/types/dashboard_page_public.py +24 -0
- opik/rest_api/types/dashboard_public.py +30 -0
- opik/rest_api/types/dataset.py +2 -0
- opik/rest_api/types/dataset_item.py +2 -0
- opik/rest_api/types/dataset_item_compare.py +2 -0
- opik/rest_api/types/dataset_item_filter.py +23 -0
- opik/rest_api/types/dataset_item_filter_operator.py +21 -0
- opik/rest_api/types/dataset_item_page_compare.py +1 -0
- opik/rest_api/types/dataset_item_page_public.py +1 -0
- opik/rest_api/types/dataset_item_public.py +2 -0
- opik/rest_api/types/dataset_item_update.py +39 -0
- opik/rest_api/types/dataset_item_write.py +1 -0
- opik/rest_api/types/dataset_public.py +2 -0
- opik/rest_api/types/dataset_public_status.py +5 -0
- opik/rest_api/types/dataset_status.py +5 -0
- opik/rest_api/types/dataset_version_diff.py +22 -0
- opik/rest_api/types/dataset_version_diff_stats.py +24 -0
- opik/rest_api/types/dataset_version_page_public.py +23 -0
- opik/rest_api/types/dataset_version_public.py +49 -0
- opik/rest_api/types/experiment.py +2 -0
- opik/rest_api/types/experiment_public.py +2 -0
- opik/rest_api/types/experiment_score.py +20 -0
- opik/rest_api/types/experiment_score_public.py +20 -0
- opik/rest_api/types/experiment_score_write.py +20 -0
- opik/rest_api/types/feedback.py +20 -1
- opik/rest_api/types/feedback_create.py +16 -1
- opik/rest_api/types/feedback_object_public.py +22 -1
- opik/rest_api/types/feedback_public.py +20 -1
- opik/rest_api/types/feedback_score_public.py +4 -0
- opik/rest_api/types/feedback_update.py +16 -1
- opik/rest_api/types/image_url.py +20 -0
- opik/rest_api/types/image_url_public.py +20 -0
- opik/rest_api/types/image_url_write.py +20 -0
- opik/rest_api/types/llm_as_judge_message.py +5 -1
- opik/rest_api/types/llm_as_judge_message_content.py +24 -0
- opik/rest_api/types/llm_as_judge_message_content_public.py +24 -0
- opik/rest_api/types/llm_as_judge_message_content_write.py +24 -0
- opik/rest_api/types/llm_as_judge_message_public.py +5 -1
- opik/rest_api/types/llm_as_judge_message_write.py +5 -1
- opik/rest_api/types/llm_as_judge_model_parameters.py +2 -0
- opik/rest_api/types/llm_as_judge_model_parameters_public.py +2 -0
- opik/rest_api/types/llm_as_judge_model_parameters_write.py +2 -0
- opik/rest_api/types/optimization.py +2 -0
- opik/rest_api/types/optimization_public.py +2 -0
- opik/rest_api/types/optimization_public_status.py +3 -1
- opik/rest_api/types/optimization_status.py +3 -1
- opik/rest_api/types/optimization_studio_config.py +27 -0
- opik/rest_api/types/optimization_studio_config_public.py +27 -0
- opik/rest_api/types/optimization_studio_config_write.py +27 -0
- opik/rest_api/types/optimization_studio_log.py +22 -0
- opik/rest_api/types/optimization_write.py +2 -0
- opik/rest_api/types/optimization_write_status.py +3 -1
- opik/rest_api/types/prompt.py +6 -0
- opik/rest_api/types/prompt_detail.py +6 -0
- opik/rest_api/types/prompt_detail_template_structure.py +5 -0
- opik/rest_api/types/prompt_public.py +6 -0
- opik/rest_api/types/prompt_public_template_structure.py +5 -0
- opik/rest_api/types/prompt_template_structure.py +5 -0
- opik/rest_api/types/prompt_version.py +2 -0
- opik/rest_api/types/prompt_version_detail.py +2 -0
- opik/rest_api/types/prompt_version_detail_template_structure.py +5 -0
- opik/rest_api/types/prompt_version_public.py +2 -0
- opik/rest_api/types/prompt_version_public_template_structure.py +5 -0
- opik/rest_api/types/prompt_version_template_structure.py +5 -0
- opik/rest_api/types/score_name.py +1 -0
- opik/rest_api/types/service_toggles_config.py +6 -0
- opik/rest_api/types/span_enrichment_options.py +31 -0
- opik/rest_api/types/span_filter.py +23 -0
- opik/rest_api/types/span_filter_operator.py +21 -0
- opik/rest_api/types/span_filter_write.py +23 -0
- opik/rest_api/types/span_filter_write_operator.py +21 -0
- opik/rest_api/types/span_llm_as_judge_code.py +27 -0
- opik/rest_api/types/span_llm_as_judge_code_public.py +27 -0
- opik/rest_api/types/span_llm_as_judge_code_write.py +27 -0
- opik/rest_api/types/span_update.py +46 -0
- opik/rest_api/types/studio_evaluation.py +20 -0
- opik/rest_api/types/studio_evaluation_public.py +20 -0
- opik/rest_api/types/studio_evaluation_write.py +20 -0
- opik/rest_api/types/studio_llm_model.py +21 -0
- opik/rest_api/types/studio_llm_model_public.py +21 -0
- opik/rest_api/types/studio_llm_model_write.py +21 -0
- opik/rest_api/types/studio_message.py +20 -0
- opik/rest_api/types/studio_message_public.py +20 -0
- opik/rest_api/types/studio_message_write.py +20 -0
- opik/rest_api/types/studio_metric.py +21 -0
- opik/rest_api/types/studio_metric_public.py +21 -0
- opik/rest_api/types/studio_metric_write.py +21 -0
- opik/rest_api/types/studio_optimizer.py +21 -0
- opik/rest_api/types/studio_optimizer_public.py +21 -0
- opik/rest_api/types/studio_optimizer_write.py +21 -0
- opik/rest_api/types/studio_prompt.py +20 -0
- opik/rest_api/types/studio_prompt_public.py +20 -0
- opik/rest_api/types/studio_prompt_write.py +20 -0
- opik/rest_api/types/trace.py +6 -0
- opik/rest_api/types/trace_public.py +6 -0
- opik/rest_api/types/trace_thread_filter_write.py +23 -0
- opik/rest_api/types/trace_thread_filter_write_operator.py +21 -0
- opik/rest_api/types/trace_thread_update.py +19 -0
- opik/rest_api/types/trace_update.py +39 -0
- opik/rest_api/types/value_entry.py +2 -0
- opik/rest_api/types/value_entry_compare.py +2 -0
- opik/rest_api/types/value_entry_experiment_item_bulk_write_view.py +2 -0
- opik/rest_api/types/value_entry_public.py +2 -0
- opik/rest_api/types/video_url.py +19 -0
- opik/rest_api/types/video_url_public.py +19 -0
- opik/rest_api/types/video_url_write.py +19 -0
- opik/synchronization.py +5 -6
- opik/{decorator/tracing_runtime_config.py → tracing_runtime_config.py} +6 -7
- {opik-1.9.5.dist-info → opik-1.9.39.dist-info}/METADATA +5 -4
- {opik-1.9.5.dist-info → opik-1.9.39.dist-info}/RECORD +246 -151
- opik/api_objects/prompt/chat_prompt_template.py +0 -164
- opik/api_objects/prompt/prompt.py +0 -131
- /opik/rest_api/{spans/types → types}/span_update_type.py +0 -0
- {opik-1.9.5.dist-info → opik-1.9.39.dist-info}/WHEEL +0 -0
- {opik-1.9.5.dist-info → opik-1.9.39.dist-info}/entry_points.txt +0 -0
- {opik-1.9.5.dist-info → opik-1.9.39.dist-info}/licenses/LICENSE +0 -0
- {opik-1.9.5.dist-info → opik-1.9.39.dist-info}/top_level.txt +0 -0
|
@@ -8,7 +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 .span_filter import SpanFilter
|
|
12
|
+
from .span_llm_as_judge_code import SpanLlmAsJudgeCode
|
|
11
13
|
from .trace_filter import TraceFilter
|
|
14
|
+
from .trace_thread_filter import TraceThreadFilter
|
|
12
15
|
from .trace_thread_llm_as_judge_code import TraceThreadLlmAsJudgeCode
|
|
13
16
|
from .trace_thread_user_defined_metric_python_code import TraceThreadUserDefinedMetricPythonCode
|
|
14
17
|
from .user_defined_metric_python_code import UserDefinedMetricPythonCode
|
|
@@ -21,7 +24,6 @@ class Base(UniversalBaseModel):
|
|
|
21
24
|
name: str
|
|
22
25
|
sampling_rate: typing.Optional[float] = None
|
|
23
26
|
enabled: typing.Optional[bool] = None
|
|
24
|
-
filters: typing.Optional[typing.List[TraceFilter]] = None
|
|
25
27
|
created_at: typing.Optional[dt.datetime] = None
|
|
26
28
|
created_by: typing.Optional[str] = None
|
|
27
29
|
last_updated_at: typing.Optional[dt.datetime] = None
|
|
@@ -40,6 +42,7 @@ class Base(UniversalBaseModel):
|
|
|
40
42
|
|
|
41
43
|
class AutomationRuleEvaluator_LlmAsJudge(Base):
|
|
42
44
|
type: typing.Literal["llm_as_judge"] = "llm_as_judge"
|
|
45
|
+
filters: typing.Optional[typing.List[TraceFilter]] = None
|
|
43
46
|
code: typing.Optional[LlmAsJudgeCode] = None
|
|
44
47
|
|
|
45
48
|
if IS_PYDANTIC_V2:
|
|
@@ -54,6 +57,7 @@ class AutomationRuleEvaluator_LlmAsJudge(Base):
|
|
|
54
57
|
|
|
55
58
|
class AutomationRuleEvaluator_UserDefinedMetricPython(Base):
|
|
56
59
|
type: typing.Literal["user_defined_metric_python"] = "user_defined_metric_python"
|
|
60
|
+
filters: typing.Optional[typing.List[TraceFilter]] = None
|
|
57
61
|
code: typing.Optional[UserDefinedMetricPythonCode] = None
|
|
58
62
|
|
|
59
63
|
if IS_PYDANTIC_V2:
|
|
@@ -68,6 +72,7 @@ class AutomationRuleEvaluator_UserDefinedMetricPython(Base):
|
|
|
68
72
|
|
|
69
73
|
class AutomationRuleEvaluator_TraceThreadLlmAsJudge(Base):
|
|
70
74
|
type: typing.Literal["trace_thread_llm_as_judge"] = "trace_thread_llm_as_judge"
|
|
75
|
+
filters: typing.Optional[typing.List[TraceThreadFilter]] = None
|
|
71
76
|
code: typing.Optional[TraceThreadLlmAsJudgeCode] = None
|
|
72
77
|
|
|
73
78
|
if IS_PYDANTIC_V2:
|
|
@@ -82,6 +87,7 @@ class AutomationRuleEvaluator_TraceThreadLlmAsJudge(Base):
|
|
|
82
87
|
|
|
83
88
|
class AutomationRuleEvaluator_TraceThreadUserDefinedMetricPython(Base):
|
|
84
89
|
type: typing.Literal["trace_thread_user_defined_metric_python"] = "trace_thread_user_defined_metric_python"
|
|
90
|
+
filters: typing.Optional[typing.List[TraceThreadFilter]] = None
|
|
85
91
|
code: typing.Optional[TraceThreadUserDefinedMetricPythonCode] = None
|
|
86
92
|
|
|
87
93
|
if IS_PYDANTIC_V2:
|
|
@@ -94,9 +100,25 @@ class AutomationRuleEvaluator_TraceThreadUserDefinedMetricPython(Base):
|
|
|
94
100
|
extra = pydantic.Extra.allow
|
|
95
101
|
|
|
96
102
|
|
|
103
|
+
class AutomationRuleEvaluator_SpanLlmAsJudge(Base):
|
|
104
|
+
type: typing.Literal["span_llm_as_judge"] = "span_llm_as_judge"
|
|
105
|
+
filters: typing.Optional[typing.List[SpanFilter]] = None
|
|
106
|
+
code: typing.Optional[SpanLlmAsJudgeCode] = None
|
|
107
|
+
|
|
108
|
+
if IS_PYDANTIC_V2:
|
|
109
|
+
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
|
|
110
|
+
else:
|
|
111
|
+
|
|
112
|
+
class Config:
|
|
113
|
+
frozen = True
|
|
114
|
+
smart_union = True
|
|
115
|
+
extra = pydantic.Extra.allow
|
|
116
|
+
|
|
117
|
+
|
|
97
118
|
AutomationRuleEvaluator = typing.Union[
|
|
98
119
|
AutomationRuleEvaluator_LlmAsJudge,
|
|
99
120
|
AutomationRuleEvaluator_UserDefinedMetricPython,
|
|
100
121
|
AutomationRuleEvaluator_TraceThreadLlmAsJudge,
|
|
101
122
|
AutomationRuleEvaluator_TraceThreadUserDefinedMetricPython,
|
|
123
|
+
AutomationRuleEvaluator_SpanLlmAsJudge,
|
|
102
124
|
]
|
|
@@ -5,9 +5,11 @@ import typing
|
|
|
5
5
|
import pydantic
|
|
6
6
|
from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
|
|
7
7
|
from .llm_as_judge_code import LlmAsJudgeCode
|
|
8
|
+
from .trace_filter import TraceFilter
|
|
8
9
|
|
|
9
10
|
|
|
10
11
|
class AutomationRuleEvaluatorLlmAsJudge(UniversalBaseModel):
|
|
12
|
+
filters: typing.Optional[typing.List[TraceFilter]] = None
|
|
11
13
|
code: typing.Optional[LlmAsJudgeCode] = None
|
|
12
14
|
|
|
13
15
|
if IS_PYDANTIC_V2:
|
|
@@ -5,9 +5,11 @@ import typing
|
|
|
5
5
|
import pydantic
|
|
6
6
|
from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
|
|
7
7
|
from .llm_as_judge_code_public import LlmAsJudgeCodePublic
|
|
8
|
+
from .trace_filter_public import TraceFilterPublic
|
|
8
9
|
|
|
9
10
|
|
|
10
11
|
class AutomationRuleEvaluatorLlmAsJudgePublic(UniversalBaseModel):
|
|
12
|
+
filters: typing.Optional[typing.List[TraceFilterPublic]] = None
|
|
11
13
|
code: typing.Optional[LlmAsJudgeCodePublic] = None
|
|
12
14
|
|
|
13
15
|
if IS_PYDANTIC_V2:
|
|
@@ -5,9 +5,11 @@ import typing
|
|
|
5
5
|
import pydantic
|
|
6
6
|
from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
|
|
7
7
|
from .llm_as_judge_code_write import LlmAsJudgeCodeWrite
|
|
8
|
+
from .trace_filter_write import TraceFilterWrite
|
|
8
9
|
|
|
9
10
|
|
|
10
11
|
class AutomationRuleEvaluatorLlmAsJudgeWrite(UniversalBaseModel):
|
|
12
|
+
filters: typing.Optional[typing.List[TraceFilterWrite]] = None
|
|
11
13
|
code: typing.Optional[LlmAsJudgeCodeWrite] = None
|
|
12
14
|
|
|
13
15
|
if IS_PYDANTIC_V2:
|
|
@@ -8,7 +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 .span_filter_public import SpanFilterPublic
|
|
12
|
+
from .span_llm_as_judge_code_public import SpanLlmAsJudgeCodePublic
|
|
11
13
|
from .trace_filter_public import TraceFilterPublic
|
|
14
|
+
from .trace_thread_filter_public import TraceThreadFilterPublic
|
|
12
15
|
from .trace_thread_llm_as_judge_code_public import TraceThreadLlmAsJudgeCodePublic
|
|
13
16
|
from .trace_thread_user_defined_metric_python_code_public import TraceThreadUserDefinedMetricPythonCodePublic
|
|
14
17
|
from .user_defined_metric_python_code_public import UserDefinedMetricPythonCodePublic
|
|
@@ -21,7 +24,6 @@ class Base(UniversalBaseModel):
|
|
|
21
24
|
name: str
|
|
22
25
|
sampling_rate: typing.Optional[float] = None
|
|
23
26
|
enabled: typing.Optional[bool] = None
|
|
24
|
-
filters: typing.Optional[typing.List[TraceFilterPublic]] = None
|
|
25
27
|
created_at: typing.Optional[dt.datetime] = None
|
|
26
28
|
created_by: typing.Optional[str] = None
|
|
27
29
|
last_updated_at: typing.Optional[dt.datetime] = None
|
|
@@ -38,8 +40,9 @@ class Base(UniversalBaseModel):
|
|
|
38
40
|
extra = pydantic.Extra.allow
|
|
39
41
|
|
|
40
42
|
|
|
41
|
-
class
|
|
43
|
+
class AutomationRuleEvaluatorObjectObjectPublic_LlmAsJudge(Base):
|
|
42
44
|
type: typing.Literal["llm_as_judge"] = "llm_as_judge"
|
|
45
|
+
filters: typing.Optional[typing.List[TraceFilterPublic]] = None
|
|
43
46
|
code: typing.Optional[LlmAsJudgeCodePublic] = None
|
|
44
47
|
|
|
45
48
|
if IS_PYDANTIC_V2:
|
|
@@ -52,8 +55,9 @@ class AutomationRuleEvaluatorObjectPublic_LlmAsJudge(Base):
|
|
|
52
55
|
extra = pydantic.Extra.allow
|
|
53
56
|
|
|
54
57
|
|
|
55
|
-
class
|
|
58
|
+
class AutomationRuleEvaluatorObjectObjectPublic_UserDefinedMetricPython(Base):
|
|
56
59
|
type: typing.Literal["user_defined_metric_python"] = "user_defined_metric_python"
|
|
60
|
+
filters: typing.Optional[typing.List[TraceFilterPublic]] = None
|
|
57
61
|
code: typing.Optional[UserDefinedMetricPythonCodePublic] = None
|
|
58
62
|
|
|
59
63
|
if IS_PYDANTIC_V2:
|
|
@@ -66,8 +70,9 @@ class AutomationRuleEvaluatorObjectPublic_UserDefinedMetricPython(Base):
|
|
|
66
70
|
extra = pydantic.Extra.allow
|
|
67
71
|
|
|
68
72
|
|
|
69
|
-
class
|
|
73
|
+
class AutomationRuleEvaluatorObjectObjectPublic_TraceThreadLlmAsJudge(Base):
|
|
70
74
|
type: typing.Literal["trace_thread_llm_as_judge"] = "trace_thread_llm_as_judge"
|
|
75
|
+
filters: typing.Optional[typing.List[TraceThreadFilterPublic]] = None
|
|
71
76
|
code: typing.Optional[TraceThreadLlmAsJudgeCodePublic] = None
|
|
72
77
|
|
|
73
78
|
if IS_PYDANTIC_V2:
|
|
@@ -80,8 +85,9 @@ class AutomationRuleEvaluatorObjectPublic_TraceThreadLlmAsJudge(Base):
|
|
|
80
85
|
extra = pydantic.Extra.allow
|
|
81
86
|
|
|
82
87
|
|
|
83
|
-
class
|
|
88
|
+
class AutomationRuleEvaluatorObjectObjectPublic_TraceThreadUserDefinedMetricPython(Base):
|
|
84
89
|
type: typing.Literal["trace_thread_user_defined_metric_python"] = "trace_thread_user_defined_metric_python"
|
|
90
|
+
filters: typing.Optional[typing.List[TraceThreadFilterPublic]] = None
|
|
85
91
|
code: typing.Optional[TraceThreadUserDefinedMetricPythonCodePublic] = None
|
|
86
92
|
|
|
87
93
|
if IS_PYDANTIC_V2:
|
|
@@ -94,9 +100,25 @@ class AutomationRuleEvaluatorObjectPublic_TraceThreadUserDefinedMetricPython(Bas
|
|
|
94
100
|
extra = pydantic.Extra.allow
|
|
95
101
|
|
|
96
102
|
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
103
|
+
class AutomationRuleEvaluatorObjectObjectPublic_SpanLlmAsJudge(Base):
|
|
104
|
+
type: typing.Literal["span_llm_as_judge"] = "span_llm_as_judge"
|
|
105
|
+
filters: typing.Optional[typing.List[SpanFilterPublic]] = None
|
|
106
|
+
code: typing.Optional[SpanLlmAsJudgeCodePublic] = None
|
|
107
|
+
|
|
108
|
+
if IS_PYDANTIC_V2:
|
|
109
|
+
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
|
|
110
|
+
else:
|
|
111
|
+
|
|
112
|
+
class Config:
|
|
113
|
+
frozen = True
|
|
114
|
+
smart_union = True
|
|
115
|
+
extra = pydantic.Extra.allow
|
|
116
|
+
|
|
117
|
+
|
|
118
|
+
AutomationRuleEvaluatorObjectObjectPublic = typing.Union[
|
|
119
|
+
AutomationRuleEvaluatorObjectObjectPublic_LlmAsJudge,
|
|
120
|
+
AutomationRuleEvaluatorObjectObjectPublic_UserDefinedMetricPython,
|
|
121
|
+
AutomationRuleEvaluatorObjectObjectPublic_TraceThreadLlmAsJudge,
|
|
122
|
+
AutomationRuleEvaluatorObjectObjectPublic_TraceThreadUserDefinedMetricPython,
|
|
123
|
+
AutomationRuleEvaluatorObjectObjectPublic_SpanLlmAsJudge,
|
|
102
124
|
]
|
|
@@ -4,14 +4,14 @@ import typing
|
|
|
4
4
|
|
|
5
5
|
import pydantic
|
|
6
6
|
from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
|
|
7
|
-
from .
|
|
7
|
+
from .automation_rule_evaluator_object_object_public import AutomationRuleEvaluatorObjectObjectPublic
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
class AutomationRuleEvaluatorPagePublic(UniversalBaseModel):
|
|
11
11
|
page: typing.Optional[int] = None
|
|
12
12
|
size: typing.Optional[int] = None
|
|
13
13
|
total: typing.Optional[int] = None
|
|
14
|
-
content: typing.Optional[typing.List[
|
|
14
|
+
content: typing.Optional[typing.List[AutomationRuleEvaluatorObjectObjectPublic]] = None
|
|
15
15
|
sortable_by: typing.Optional[typing.List[str]] = None
|
|
16
16
|
|
|
17
17
|
if IS_PYDANTIC_V2:
|
|
@@ -8,7 +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 .span_filter_public import SpanFilterPublic
|
|
12
|
+
from .span_llm_as_judge_code_public import SpanLlmAsJudgeCodePublic
|
|
11
13
|
from .trace_filter_public import TraceFilterPublic
|
|
14
|
+
from .trace_thread_filter_public import TraceThreadFilterPublic
|
|
12
15
|
from .trace_thread_llm_as_judge_code_public import TraceThreadLlmAsJudgeCodePublic
|
|
13
16
|
from .trace_thread_user_defined_metric_python_code_public import TraceThreadUserDefinedMetricPythonCodePublic
|
|
14
17
|
from .user_defined_metric_python_code_public import UserDefinedMetricPythonCodePublic
|
|
@@ -21,7 +24,6 @@ class Base(UniversalBaseModel):
|
|
|
21
24
|
name: str
|
|
22
25
|
sampling_rate: typing.Optional[float] = None
|
|
23
26
|
enabled: typing.Optional[bool] = None
|
|
24
|
-
filters: typing.Optional[typing.List[TraceFilterPublic]] = None
|
|
25
27
|
created_at: typing.Optional[dt.datetime] = None
|
|
26
28
|
created_by: typing.Optional[str] = None
|
|
27
29
|
last_updated_at: typing.Optional[dt.datetime] = None
|
|
@@ -40,6 +42,7 @@ class Base(UniversalBaseModel):
|
|
|
40
42
|
|
|
41
43
|
class AutomationRuleEvaluatorPublic_LlmAsJudge(Base):
|
|
42
44
|
type: typing.Literal["llm_as_judge"] = "llm_as_judge"
|
|
45
|
+
filters: typing.Optional[typing.List[TraceFilterPublic]] = None
|
|
43
46
|
code: typing.Optional[LlmAsJudgeCodePublic] = None
|
|
44
47
|
|
|
45
48
|
if IS_PYDANTIC_V2:
|
|
@@ -54,6 +57,7 @@ class AutomationRuleEvaluatorPublic_LlmAsJudge(Base):
|
|
|
54
57
|
|
|
55
58
|
class AutomationRuleEvaluatorPublic_UserDefinedMetricPython(Base):
|
|
56
59
|
type: typing.Literal["user_defined_metric_python"] = "user_defined_metric_python"
|
|
60
|
+
filters: typing.Optional[typing.List[TraceFilterPublic]] = None
|
|
57
61
|
code: typing.Optional[UserDefinedMetricPythonCodePublic] = None
|
|
58
62
|
|
|
59
63
|
if IS_PYDANTIC_V2:
|
|
@@ -68,6 +72,7 @@ class AutomationRuleEvaluatorPublic_UserDefinedMetricPython(Base):
|
|
|
68
72
|
|
|
69
73
|
class AutomationRuleEvaluatorPublic_TraceThreadLlmAsJudge(Base):
|
|
70
74
|
type: typing.Literal["trace_thread_llm_as_judge"] = "trace_thread_llm_as_judge"
|
|
75
|
+
filters: typing.Optional[typing.List[TraceThreadFilterPublic]] = None
|
|
71
76
|
code: typing.Optional[TraceThreadLlmAsJudgeCodePublic] = None
|
|
72
77
|
|
|
73
78
|
if IS_PYDANTIC_V2:
|
|
@@ -82,6 +87,7 @@ class AutomationRuleEvaluatorPublic_TraceThreadLlmAsJudge(Base):
|
|
|
82
87
|
|
|
83
88
|
class AutomationRuleEvaluatorPublic_TraceThreadUserDefinedMetricPython(Base):
|
|
84
89
|
type: typing.Literal["trace_thread_user_defined_metric_python"] = "trace_thread_user_defined_metric_python"
|
|
90
|
+
filters: typing.Optional[typing.List[TraceThreadFilterPublic]] = None
|
|
85
91
|
code: typing.Optional[TraceThreadUserDefinedMetricPythonCodePublic] = None
|
|
86
92
|
|
|
87
93
|
if IS_PYDANTIC_V2:
|
|
@@ -94,9 +100,25 @@ class AutomationRuleEvaluatorPublic_TraceThreadUserDefinedMetricPython(Base):
|
|
|
94
100
|
extra = pydantic.Extra.allow
|
|
95
101
|
|
|
96
102
|
|
|
103
|
+
class AutomationRuleEvaluatorPublic_SpanLlmAsJudge(Base):
|
|
104
|
+
type: typing.Literal["span_llm_as_judge"] = "span_llm_as_judge"
|
|
105
|
+
filters: typing.Optional[typing.List[SpanFilterPublic]] = None
|
|
106
|
+
code: typing.Optional[SpanLlmAsJudgeCodePublic] = None
|
|
107
|
+
|
|
108
|
+
if IS_PYDANTIC_V2:
|
|
109
|
+
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
|
|
110
|
+
else:
|
|
111
|
+
|
|
112
|
+
class Config:
|
|
113
|
+
frozen = True
|
|
114
|
+
smart_union = True
|
|
115
|
+
extra = pydantic.Extra.allow
|
|
116
|
+
|
|
117
|
+
|
|
97
118
|
AutomationRuleEvaluatorPublic = typing.Union[
|
|
98
119
|
AutomationRuleEvaluatorPublic_LlmAsJudge,
|
|
99
120
|
AutomationRuleEvaluatorPublic_UserDefinedMetricPython,
|
|
100
121
|
AutomationRuleEvaluatorPublic_TraceThreadLlmAsJudge,
|
|
101
122
|
AutomationRuleEvaluatorPublic_TraceThreadUserDefinedMetricPython,
|
|
123
|
+
AutomationRuleEvaluatorPublic_SpanLlmAsJudge,
|
|
102
124
|
]
|
|
@@ -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_llm_as_judge_code import SpanLlmAsJudgeCode
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
class AutomationRuleEvaluatorSpanLlmAsJudge(UniversalBaseModel):
|
|
12
|
+
filters: typing.Optional[typing.List[SpanFilter]] = None
|
|
13
|
+
code: typing.Optional[SpanLlmAsJudgeCode] = 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_llm_as_judge_code_public import SpanLlmAsJudgeCodePublic
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
class AutomationRuleEvaluatorSpanLlmAsJudgePublic(UniversalBaseModel):
|
|
12
|
+
filters: typing.Optional[typing.List[SpanFilterPublic]] = None
|
|
13
|
+
code: typing.Optional[SpanLlmAsJudgeCodePublic] = 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_llm_as_judge_code_write import SpanLlmAsJudgeCodeWrite
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
class AutomationRuleEvaluatorSpanLlmAsJudgeWrite(UniversalBaseModel):
|
|
12
|
+
filters: typing.Optional[typing.List[SpanFilterWrite]] = None
|
|
13
|
+
code: typing.Optional[SpanLlmAsJudgeCodeWrite] = 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
|
|
@@ -4,10 +4,12 @@ import typing
|
|
|
4
4
|
|
|
5
5
|
import pydantic
|
|
6
6
|
from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
|
|
7
|
+
from .trace_thread_filter import TraceThreadFilter
|
|
7
8
|
from .trace_thread_llm_as_judge_code import TraceThreadLlmAsJudgeCode
|
|
8
9
|
|
|
9
10
|
|
|
10
11
|
class AutomationRuleEvaluatorTraceThreadLlmAsJudge(UniversalBaseModel):
|
|
12
|
+
filters: typing.Optional[typing.List[TraceThreadFilter]] = None
|
|
11
13
|
code: typing.Optional[TraceThreadLlmAsJudgeCode] = None
|
|
12
14
|
|
|
13
15
|
if IS_PYDANTIC_V2:
|
|
@@ -4,10 +4,12 @@ import typing
|
|
|
4
4
|
|
|
5
5
|
import pydantic
|
|
6
6
|
from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
|
|
7
|
+
from .trace_thread_filter_public import TraceThreadFilterPublic
|
|
7
8
|
from .trace_thread_llm_as_judge_code_public import TraceThreadLlmAsJudgeCodePublic
|
|
8
9
|
|
|
9
10
|
|
|
10
11
|
class AutomationRuleEvaluatorTraceThreadLlmAsJudgePublic(UniversalBaseModel):
|
|
12
|
+
filters: typing.Optional[typing.List[TraceThreadFilterPublic]] = None
|
|
11
13
|
code: typing.Optional[TraceThreadLlmAsJudgeCodePublic] = None
|
|
12
14
|
|
|
13
15
|
if IS_PYDANTIC_V2:
|
|
@@ -4,10 +4,12 @@ import typing
|
|
|
4
4
|
|
|
5
5
|
import pydantic
|
|
6
6
|
from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
|
|
7
|
+
from .trace_thread_filter_write import TraceThreadFilterWrite
|
|
7
8
|
from .trace_thread_llm_as_judge_code_write import TraceThreadLlmAsJudgeCodeWrite
|
|
8
9
|
|
|
9
10
|
|
|
10
11
|
class AutomationRuleEvaluatorTraceThreadLlmAsJudgeWrite(UniversalBaseModel):
|
|
12
|
+
filters: typing.Optional[typing.List[TraceThreadFilterWrite]] = None
|
|
11
13
|
code: typing.Optional[TraceThreadLlmAsJudgeCodeWrite] = None
|
|
12
14
|
|
|
13
15
|
if IS_PYDANTIC_V2:
|
|
@@ -4,10 +4,12 @@ import typing
|
|
|
4
4
|
|
|
5
5
|
import pydantic
|
|
6
6
|
from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
|
|
7
|
+
from .trace_thread_filter import TraceThreadFilter
|
|
7
8
|
from .trace_thread_user_defined_metric_python_code import TraceThreadUserDefinedMetricPythonCode
|
|
8
9
|
|
|
9
10
|
|
|
10
11
|
class AutomationRuleEvaluatorTraceThreadUserDefinedMetricPython(UniversalBaseModel):
|
|
12
|
+
filters: typing.Optional[typing.List[TraceThreadFilter]] = None
|
|
11
13
|
code: typing.Optional[TraceThreadUserDefinedMetricPythonCode] = None
|
|
12
14
|
|
|
13
15
|
if IS_PYDANTIC_V2:
|
opik/rest_api/types/automation_rule_evaluator_trace_thread_user_defined_metric_python_public.py
CHANGED
|
@@ -4,10 +4,12 @@ import typing
|
|
|
4
4
|
|
|
5
5
|
import pydantic
|
|
6
6
|
from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
|
|
7
|
+
from .trace_thread_filter_public import TraceThreadFilterPublic
|
|
7
8
|
from .trace_thread_user_defined_metric_python_code_public import TraceThreadUserDefinedMetricPythonCodePublic
|
|
8
9
|
|
|
9
10
|
|
|
10
11
|
class AutomationRuleEvaluatorTraceThreadUserDefinedMetricPythonPublic(UniversalBaseModel):
|
|
12
|
+
filters: typing.Optional[typing.List[TraceThreadFilterPublic]] = None
|
|
11
13
|
code: typing.Optional[TraceThreadUserDefinedMetricPythonCodePublic] = None
|
|
12
14
|
|
|
13
15
|
if IS_PYDANTIC_V2:
|
opik/rest_api/types/automation_rule_evaluator_trace_thread_user_defined_metric_python_write.py
CHANGED
|
@@ -4,10 +4,12 @@ import typing
|
|
|
4
4
|
|
|
5
5
|
import pydantic
|
|
6
6
|
from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
|
|
7
|
+
from .trace_thread_filter_write import TraceThreadFilterWrite
|
|
7
8
|
from .trace_thread_user_defined_metric_python_code_write import TraceThreadUserDefinedMetricPythonCodeWrite
|
|
8
9
|
|
|
9
10
|
|
|
10
11
|
class AutomationRuleEvaluatorTraceThreadUserDefinedMetricPythonWrite(UniversalBaseModel):
|
|
12
|
+
filters: typing.Optional[typing.List[TraceThreadFilterWrite]] = None
|
|
11
13
|
code: typing.Optional[TraceThreadUserDefinedMetricPythonCodeWrite] = None
|
|
12
14
|
|
|
13
15
|
if IS_PYDANTIC_V2:
|
|
@@ -7,7 +7,10 @@ import typing
|
|
|
7
7
|
import pydantic
|
|
8
8
|
from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
|
|
9
9
|
from .llm_as_judge_code import LlmAsJudgeCode
|
|
10
|
+
from .span_filter import SpanFilter
|
|
11
|
+
from .span_llm_as_judge_code import SpanLlmAsJudgeCode
|
|
10
12
|
from .trace_filter import TraceFilter
|
|
13
|
+
from .trace_thread_filter import TraceThreadFilter
|
|
11
14
|
from .trace_thread_llm_as_judge_code import TraceThreadLlmAsJudgeCode
|
|
12
15
|
from .trace_thread_user_defined_metric_python_code import TraceThreadUserDefinedMetricPythonCode
|
|
13
16
|
from .user_defined_metric_python_code import UserDefinedMetricPythonCode
|
|
@@ -17,7 +20,6 @@ class Base(UniversalBaseModel):
|
|
|
17
20
|
name: str
|
|
18
21
|
sampling_rate: typing.Optional[float] = None
|
|
19
22
|
enabled: typing.Optional[bool] = None
|
|
20
|
-
filters: typing.Optional[typing.List[TraceFilter]] = None
|
|
21
23
|
project_id: str
|
|
22
24
|
action: typing.Literal["evaluator"] = "evaluator"
|
|
23
25
|
|
|
@@ -33,6 +35,7 @@ class Base(UniversalBaseModel):
|
|
|
33
35
|
|
|
34
36
|
class AutomationRuleEvaluatorUpdate_LlmAsJudge(Base):
|
|
35
37
|
type: typing.Literal["llm_as_judge"] = "llm_as_judge"
|
|
38
|
+
filters: typing.Optional[typing.List[TraceFilter]] = None
|
|
36
39
|
code: typing.Optional[LlmAsJudgeCode] = None
|
|
37
40
|
|
|
38
41
|
if IS_PYDANTIC_V2:
|
|
@@ -47,6 +50,7 @@ class AutomationRuleEvaluatorUpdate_LlmAsJudge(Base):
|
|
|
47
50
|
|
|
48
51
|
class AutomationRuleEvaluatorUpdate_UserDefinedMetricPython(Base):
|
|
49
52
|
type: typing.Literal["user_defined_metric_python"] = "user_defined_metric_python"
|
|
53
|
+
filters: typing.Optional[typing.List[TraceFilter]] = None
|
|
50
54
|
code: typing.Optional[UserDefinedMetricPythonCode] = None
|
|
51
55
|
|
|
52
56
|
if IS_PYDANTIC_V2:
|
|
@@ -61,6 +65,7 @@ class AutomationRuleEvaluatorUpdate_UserDefinedMetricPython(Base):
|
|
|
61
65
|
|
|
62
66
|
class AutomationRuleEvaluatorUpdate_TraceThreadLlmAsJudge(Base):
|
|
63
67
|
type: typing.Literal["trace_thread_llm_as_judge"] = "trace_thread_llm_as_judge"
|
|
68
|
+
filters: typing.Optional[typing.List[TraceThreadFilter]] = None
|
|
64
69
|
code: typing.Optional[TraceThreadLlmAsJudgeCode] = None
|
|
65
70
|
|
|
66
71
|
if IS_PYDANTIC_V2:
|
|
@@ -75,6 +80,7 @@ class AutomationRuleEvaluatorUpdate_TraceThreadLlmAsJudge(Base):
|
|
|
75
80
|
|
|
76
81
|
class AutomationRuleEvaluatorUpdate_TraceThreadUserDefinedMetricPython(Base):
|
|
77
82
|
type: typing.Literal["trace_thread_user_defined_metric_python"] = "trace_thread_user_defined_metric_python"
|
|
83
|
+
filters: typing.Optional[typing.List[TraceThreadFilter]] = None
|
|
78
84
|
code: typing.Optional[TraceThreadUserDefinedMetricPythonCode] = None
|
|
79
85
|
|
|
80
86
|
if IS_PYDANTIC_V2:
|
|
@@ -87,9 +93,25 @@ class AutomationRuleEvaluatorUpdate_TraceThreadUserDefinedMetricPython(Base):
|
|
|
87
93
|
extra = pydantic.Extra.allow
|
|
88
94
|
|
|
89
95
|
|
|
96
|
+
class AutomationRuleEvaluatorUpdate_SpanLlmAsJudge(Base):
|
|
97
|
+
type: typing.Literal["span_llm_as_judge"] = "span_llm_as_judge"
|
|
98
|
+
filters: typing.Optional[typing.List[SpanFilter]] = None
|
|
99
|
+
code: typing.Optional[SpanLlmAsJudgeCode] = None
|
|
100
|
+
|
|
101
|
+
if IS_PYDANTIC_V2:
|
|
102
|
+
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
|
|
103
|
+
else:
|
|
104
|
+
|
|
105
|
+
class Config:
|
|
106
|
+
frozen = True
|
|
107
|
+
smart_union = True
|
|
108
|
+
extra = pydantic.Extra.allow
|
|
109
|
+
|
|
110
|
+
|
|
90
111
|
AutomationRuleEvaluatorUpdate = typing.Union[
|
|
91
112
|
AutomationRuleEvaluatorUpdate_LlmAsJudge,
|
|
92
113
|
AutomationRuleEvaluatorUpdate_UserDefinedMetricPython,
|
|
93
114
|
AutomationRuleEvaluatorUpdate_TraceThreadLlmAsJudge,
|
|
94
115
|
AutomationRuleEvaluatorUpdate_TraceThreadUserDefinedMetricPython,
|
|
116
|
+
AutomationRuleEvaluatorUpdate_SpanLlmAsJudge,
|
|
95
117
|
]
|
|
@@ -5,9 +5,11 @@ import typing
|
|
|
5
5
|
import pydantic
|
|
6
6
|
from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
|
|
7
7
|
from .llm_as_judge_code import LlmAsJudgeCode
|
|
8
|
+
from .trace_filter import TraceFilter
|
|
8
9
|
|
|
9
10
|
|
|
10
11
|
class AutomationRuleEvaluatorUpdateLlmAsJudge(UniversalBaseModel):
|
|
12
|
+
filters: typing.Optional[typing.List[TraceFilter]] = None
|
|
11
13
|
code: typing.Optional[LlmAsJudgeCode] = None
|
|
12
14
|
|
|
13
15
|
if IS_PYDANTIC_V2:
|
|
@@ -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_llm_as_judge_code import SpanLlmAsJudgeCode
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
class AutomationRuleEvaluatorUpdateSpanLlmAsJudge(UniversalBaseModel):
|
|
12
|
+
filters: typing.Optional[typing.List[SpanFilter]] = None
|
|
13
|
+
code: typing.Optional[SpanLlmAsJudgeCode] = 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
|
|
@@ -4,10 +4,12 @@ import typing
|
|
|
4
4
|
|
|
5
5
|
import pydantic
|
|
6
6
|
from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
|
|
7
|
+
from .trace_thread_filter import TraceThreadFilter
|
|
7
8
|
from .trace_thread_llm_as_judge_code import TraceThreadLlmAsJudgeCode
|
|
8
9
|
|
|
9
10
|
|
|
10
11
|
class AutomationRuleEvaluatorUpdateTraceThreadLlmAsJudge(UniversalBaseModel):
|
|
12
|
+
filters: typing.Optional[typing.List[TraceThreadFilter]] = None
|
|
11
13
|
code: typing.Optional[TraceThreadLlmAsJudgeCode] = None
|
|
12
14
|
|
|
13
15
|
if IS_PYDANTIC_V2:
|
opik/rest_api/types/automation_rule_evaluator_update_trace_thread_user_defined_metric_python.py
CHANGED
|
@@ -4,10 +4,12 @@ import typing
|
|
|
4
4
|
|
|
5
5
|
import pydantic
|
|
6
6
|
from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
|
|
7
|
+
from .trace_thread_filter import TraceThreadFilter
|
|
7
8
|
from .trace_thread_user_defined_metric_python_code import TraceThreadUserDefinedMetricPythonCode
|
|
8
9
|
|
|
9
10
|
|
|
10
11
|
class AutomationRuleEvaluatorUpdateTraceThreadUserDefinedMetricPython(UniversalBaseModel):
|
|
12
|
+
filters: typing.Optional[typing.List[TraceThreadFilter]] = None
|
|
11
13
|
code: typing.Optional[TraceThreadUserDefinedMetricPythonCode] = None
|
|
12
14
|
|
|
13
15
|
if IS_PYDANTIC_V2:
|
|
@@ -4,10 +4,12 @@ import typing
|
|
|
4
4
|
|
|
5
5
|
import pydantic
|
|
6
6
|
from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
|
|
7
|
+
from .trace_filter import TraceFilter
|
|
7
8
|
from .user_defined_metric_python_code import UserDefinedMetricPythonCode
|
|
8
9
|
|
|
9
10
|
|
|
10
11
|
class AutomationRuleEvaluatorUpdateUserDefinedMetricPython(UniversalBaseModel):
|
|
12
|
+
filters: typing.Optional[typing.List[TraceFilter]] = None
|
|
11
13
|
code: typing.Optional[UserDefinedMetricPythonCode] = None
|
|
12
14
|
|
|
13
15
|
if IS_PYDANTIC_V2:
|
|
@@ -4,10 +4,12 @@ import typing
|
|
|
4
4
|
|
|
5
5
|
import pydantic
|
|
6
6
|
from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
|
|
7
|
+
from .trace_filter import TraceFilter
|
|
7
8
|
from .user_defined_metric_python_code import UserDefinedMetricPythonCode
|
|
8
9
|
|
|
9
10
|
|
|
10
11
|
class AutomationRuleEvaluatorUserDefinedMetricPython(UniversalBaseModel):
|
|
12
|
+
filters: typing.Optional[typing.List[TraceFilter]] = None
|
|
11
13
|
code: typing.Optional[UserDefinedMetricPythonCode] = None
|
|
12
14
|
|
|
13
15
|
if IS_PYDANTIC_V2:
|
|
@@ -4,10 +4,12 @@ import typing
|
|
|
4
4
|
|
|
5
5
|
import pydantic
|
|
6
6
|
from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
|
|
7
|
+
from .trace_filter_public import TraceFilterPublic
|
|
7
8
|
from .user_defined_metric_python_code_public import UserDefinedMetricPythonCodePublic
|
|
8
9
|
|
|
9
10
|
|
|
10
11
|
class AutomationRuleEvaluatorUserDefinedMetricPythonPublic(UniversalBaseModel):
|
|
12
|
+
filters: typing.Optional[typing.List[TraceFilterPublic]] = None
|
|
11
13
|
code: typing.Optional[UserDefinedMetricPythonCodePublic] = None
|
|
12
14
|
|
|
13
15
|
if IS_PYDANTIC_V2:
|
|
@@ -4,10 +4,12 @@ import typing
|
|
|
4
4
|
|
|
5
5
|
import pydantic
|
|
6
6
|
from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
|
|
7
|
+
from .trace_filter_write import TraceFilterWrite
|
|
7
8
|
from .user_defined_metric_python_code_write import UserDefinedMetricPythonCodeWrite
|
|
8
9
|
|
|
9
10
|
|
|
10
11
|
class AutomationRuleEvaluatorUserDefinedMetricPythonWrite(UniversalBaseModel):
|
|
12
|
+
filters: typing.Optional[typing.List[TraceFilterWrite]] = None
|
|
11
13
|
code: typing.Optional[UserDefinedMetricPythonCodeWrite] = None
|
|
12
14
|
|
|
13
15
|
if IS_PYDANTIC_V2:
|