agenta 0.52.6__py3-none-any.whl → 0.63.2__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.
- agenta/__init__.py +12 -3
- agenta/client/__init__.py +4 -4
- agenta/client/backend/__init__.py +4 -4
- agenta/client/backend/api_keys/client.py +2 -2
- agenta/client/backend/billing/client.py +2 -2
- agenta/client/backend/billing/raw_client.py +2 -2
- agenta/client/backend/client.py +56 -48
- agenta/client/backend/core/client_wrapper.py +2 -2
- agenta/client/backend/core/file.py +3 -1
- agenta/client/backend/core/http_client.py +3 -3
- agenta/client/backend/core/pydantic_utilities.py +13 -3
- agenta/client/backend/human_evaluations/client.py +2 -2
- agenta/client/backend/human_evaluations/raw_client.py +2 -2
- agenta/client/backend/organization/client.py +46 -34
- agenta/client/backend/organization/raw_client.py +32 -26
- agenta/client/backend/raw_client.py +26 -26
- agenta/client/backend/testsets/client.py +18 -18
- agenta/client/backend/testsets/raw_client.py +30 -30
- agenta/client/backend/types/__init__.py +4 -4
- agenta/client/backend/types/account_request.py +3 -1
- agenta/client/backend/types/account_response.py +3 -1
- agenta/client/backend/types/agenta_node_dto.py +3 -1
- agenta/client/backend/types/agenta_nodes_response.py +3 -1
- agenta/client/backend/types/agenta_root_dto.py +3 -1
- agenta/client/backend/types/agenta_roots_response.py +3 -1
- agenta/client/backend/types/agenta_tree_dto.py +3 -1
- agenta/client/backend/types/agenta_trees_response.py +3 -1
- agenta/client/backend/types/aggregated_result.py +3 -1
- agenta/client/backend/types/analytics_response.py +3 -1
- agenta/client/backend/types/annotation.py +6 -4
- agenta/client/backend/types/annotation_create.py +3 -1
- agenta/client/backend/types/annotation_edit.py +3 -1
- agenta/client/backend/types/annotation_link.py +3 -1
- agenta/client/backend/types/annotation_link_response.py +3 -1
- agenta/client/backend/types/annotation_query.py +3 -1
- agenta/client/backend/types/annotation_query_request.py +3 -1
- agenta/client/backend/types/annotation_reference.py +3 -1
- agenta/client/backend/types/annotation_references.py +3 -1
- agenta/client/backend/types/annotation_response.py +3 -1
- agenta/client/backend/types/annotations_response.py +3 -1
- agenta/client/backend/types/app.py +3 -1
- agenta/client/backend/types/app_variant_response.py +3 -1
- agenta/client/backend/types/app_variant_revision.py +3 -1
- agenta/client/backend/types/artifact.py +6 -4
- agenta/client/backend/types/base_output.py +3 -1
- agenta/client/backend/types/body_fetch_workflow_revision.py +3 -1
- agenta/client/backend/types/body_import_testset.py +3 -1
- agenta/client/backend/types/bucket_dto.py +3 -1
- agenta/client/backend/types/collect_status_response.py +3 -1
- agenta/client/backend/types/config_db.py +3 -1
- agenta/client/backend/types/config_dto.py +3 -1
- agenta/client/backend/types/config_response_model.py +3 -1
- agenta/client/backend/types/correct_answer.py +3 -1
- agenta/client/backend/types/create_app_output.py +3 -1
- agenta/client/backend/types/custom_model_settings_dto.py +3 -1
- agenta/client/backend/types/custom_provider_dto.py +3 -1
- agenta/client/backend/types/custom_provider_kind.py +1 -1
- agenta/client/backend/types/custom_provider_settings_dto.py +3 -1
- agenta/client/backend/types/delete_evaluation.py +3 -1
- agenta/client/backend/types/environment_output.py +3 -1
- agenta/client/backend/types/environment_output_extended.py +3 -1
- agenta/client/backend/types/environment_revision.py +3 -1
- agenta/client/backend/types/error.py +3 -1
- agenta/client/backend/types/evaluation.py +3 -1
- agenta/client/backend/types/evaluation_scenario.py +3 -1
- agenta/client/backend/types/evaluation_scenario_input.py +3 -1
- agenta/client/backend/types/evaluation_scenario_output.py +3 -1
- agenta/client/backend/types/evaluation_scenario_result.py +3 -1
- agenta/client/backend/types/evaluator.py +6 -4
- agenta/client/backend/types/evaluator_config.py +6 -4
- agenta/client/backend/types/evaluator_flags.py +3 -1
- agenta/client/backend/types/evaluator_mapping_output_interface.py +3 -1
- agenta/client/backend/types/evaluator_output_interface.py +3 -1
- agenta/client/backend/types/evaluator_query.py +3 -1
- agenta/client/backend/types/evaluator_query_request.py +3 -1
- agenta/client/backend/types/evaluator_request.py +3 -1
- agenta/client/backend/types/evaluator_response.py +3 -1
- agenta/client/backend/types/evaluators_response.py +3 -1
- agenta/client/backend/types/exception_dto.py +3 -1
- agenta/client/backend/types/extended_o_tel_tracing_response.py +3 -1
- agenta/client/backend/types/get_config_response.py +3 -1
- agenta/client/backend/types/header.py +3 -1
- agenta/client/backend/types/http_validation_error.py +3 -1
- agenta/client/backend/types/human_evaluation.py +3 -1
- agenta/client/backend/types/human_evaluation_scenario.py +3 -1
- agenta/client/backend/types/human_evaluation_scenario_input.py +3 -1
- agenta/client/backend/types/human_evaluation_scenario_output.py +3 -1
- agenta/client/backend/types/invite_request.py +3 -1
- agenta/client/backend/types/legacy_analytics_response.py +3 -1
- agenta/client/backend/types/legacy_data_point.py +3 -1
- agenta/client/backend/types/legacy_evaluator.py +3 -1
- agenta/client/backend/types/legacy_scope_request.py +3 -1
- agenta/client/backend/types/legacy_scopes_response.py +3 -1
- agenta/client/backend/types/legacy_subscription_request.py +3 -1
- agenta/client/backend/types/legacy_user_request.py +3 -1
- agenta/client/backend/types/legacy_user_response.py +3 -1
- agenta/client/backend/types/lifecycle_dto.py +3 -1
- agenta/client/backend/types/link_dto.py +3 -1
- agenta/client/backend/types/list_api_keys_response.py +3 -1
- agenta/client/backend/types/llm_run_rate_limit.py +3 -1
- agenta/client/backend/types/meta_request.py +3 -1
- agenta/client/backend/types/metrics_dto.py +3 -1
- agenta/client/backend/types/new_testset.py +3 -1
- agenta/client/backend/types/node_dto.py +3 -1
- agenta/client/backend/types/o_tel_context_dto.py +3 -1
- agenta/client/backend/types/o_tel_event.py +6 -4
- agenta/client/backend/types/o_tel_event_dto.py +3 -1
- agenta/client/backend/types/o_tel_extra_dto.py +3 -1
- agenta/client/backend/types/o_tel_flat_span.py +6 -4
- agenta/client/backend/types/o_tel_link.py +6 -4
- agenta/client/backend/types/o_tel_link_dto.py +3 -1
- agenta/client/backend/types/o_tel_links_response.py +3 -1
- agenta/client/backend/types/o_tel_span.py +1 -1
- agenta/client/backend/types/o_tel_span_dto.py +3 -1
- agenta/client/backend/types/o_tel_spans_tree.py +3 -1
- agenta/client/backend/types/o_tel_tracing_data_response.py +3 -1
- agenta/client/backend/types/o_tel_tracing_request.py +3 -1
- agenta/client/backend/types/o_tel_tracing_response.py +3 -1
- agenta/client/backend/types/organization.py +3 -1
- agenta/client/backend/types/organization_details.py +3 -1
- agenta/client/backend/types/organization_membership_request.py +3 -1
- agenta/client/backend/types/organization_output.py +3 -1
- agenta/client/backend/types/organization_request.py +3 -1
- agenta/client/backend/types/parent_dto.py +3 -1
- agenta/client/backend/types/project_membership_request.py +3 -1
- agenta/client/backend/types/project_request.py +3 -1
- agenta/client/backend/types/project_scope.py +3 -1
- agenta/client/backend/types/projects_response.py +3 -1
- agenta/client/backend/types/reference.py +6 -4
- agenta/client/backend/types/reference_dto.py +3 -1
- agenta/client/backend/types/reference_request_model.py +3 -1
- agenta/client/backend/types/result.py +3 -1
- agenta/client/backend/types/root_dto.py +3 -1
- agenta/client/backend/types/scopes_response_model.py +3 -1
- agenta/client/backend/types/secret_dto.py +3 -1
- agenta/client/backend/types/secret_response_dto.py +3 -1
- agenta/client/backend/types/simple_evaluation_output.py +3 -1
- agenta/client/backend/types/span_dto.py +6 -4
- agenta/client/backend/types/standard_provider_dto.py +3 -1
- agenta/client/backend/types/standard_provider_settings_dto.py +3 -1
- agenta/client/backend/types/status_dto.py +3 -1
- agenta/client/backend/types/tags_request.py +3 -1
- agenta/client/backend/types/testcase_response.py +6 -4
- agenta/client/backend/types/testset.py +6 -4
- agenta/client/backend/types/{test_set_output_response.py → testset_output_response.py} +4 -2
- agenta/client/backend/types/testset_request.py +3 -1
- agenta/client/backend/types/testset_response.py +3 -1
- agenta/client/backend/types/{test_set_simple_response.py → testset_simple_response.py} +4 -2
- agenta/client/backend/types/testsets_response.py +3 -1
- agenta/client/backend/types/time_dto.py +3 -1
- agenta/client/backend/types/tree_dto.py +3 -1
- agenta/client/backend/types/update_app_output.py +3 -1
- agenta/client/backend/types/user_request.py +3 -1
- agenta/client/backend/types/validation_error.py +3 -1
- agenta/client/backend/types/workflow_artifact.py +6 -4
- agenta/client/backend/types/workflow_data.py +3 -1
- agenta/client/backend/types/workflow_flags.py +3 -1
- agenta/client/backend/types/workflow_request.py +3 -1
- agenta/client/backend/types/workflow_response.py +3 -1
- agenta/client/backend/types/workflow_revision.py +6 -4
- agenta/client/backend/types/workflow_revision_request.py +3 -1
- agenta/client/backend/types/workflow_revision_response.py +3 -1
- agenta/client/backend/types/workflow_revisions_response.py +3 -1
- agenta/client/backend/types/workflow_variant.py +6 -4
- agenta/client/backend/types/workflow_variant_request.py +3 -1
- agenta/client/backend/types/workflow_variant_response.py +3 -1
- agenta/client/backend/types/workflow_variants_response.py +3 -1
- agenta/client/backend/types/workflows_response.py +3 -1
- agenta/client/backend/types/workspace.py +3 -1
- agenta/client/backend/types/workspace_member_response.py +3 -1
- agenta/client/backend/types/workspace_membership_request.py +3 -1
- agenta/client/backend/types/workspace_permission.py +3 -1
- agenta/client/backend/types/workspace_request.py +3 -1
- agenta/client/backend/types/workspace_response.py +3 -1
- agenta/client/backend/vault/raw_client.py +4 -4
- agenta/client/backend/workspace/client.py +2 -2
- agenta/client/client.py +102 -88
- agenta/sdk/__init__.py +52 -3
- agenta/sdk/agenta_init.py +43 -16
- agenta/sdk/assets.py +23 -15
- agenta/sdk/context/serving.py +20 -8
- agenta/sdk/context/tracing.py +40 -22
- agenta/sdk/contexts/__init__.py +0 -0
- agenta/sdk/contexts/routing.py +38 -0
- agenta/sdk/contexts/running.py +57 -0
- agenta/sdk/contexts/tracing.py +86 -0
- agenta/sdk/decorators/__init__.py +1 -0
- agenta/sdk/decorators/routing.py +284 -0
- agenta/sdk/decorators/running.py +692 -98
- agenta/sdk/decorators/serving.py +20 -21
- agenta/sdk/decorators/tracing.py +176 -131
- agenta/sdk/engines/__init__.py +0 -0
- agenta/sdk/engines/running/__init__.py +0 -0
- agenta/sdk/engines/running/utils.py +17 -0
- agenta/sdk/engines/tracing/__init__.py +1 -0
- agenta/sdk/engines/tracing/attributes.py +185 -0
- agenta/sdk/engines/tracing/conventions.py +49 -0
- agenta/sdk/engines/tracing/exporters.py +130 -0
- agenta/sdk/engines/tracing/inline.py +1154 -0
- agenta/sdk/engines/tracing/processors.py +190 -0
- agenta/sdk/engines/tracing/propagation.py +102 -0
- agenta/sdk/engines/tracing/spans.py +136 -0
- agenta/sdk/engines/tracing/tracing.py +324 -0
- agenta/sdk/evaluations/__init__.py +2 -0
- agenta/sdk/evaluations/metrics.py +37 -0
- agenta/sdk/evaluations/preview/__init__.py +0 -0
- agenta/sdk/evaluations/preview/evaluate.py +765 -0
- agenta/sdk/evaluations/preview/utils.py +861 -0
- agenta/sdk/evaluations/results.py +66 -0
- agenta/sdk/evaluations/runs.py +153 -0
- agenta/sdk/evaluations/scenarios.py +48 -0
- agenta/sdk/litellm/litellm.py +12 -0
- agenta/sdk/litellm/mockllm.py +6 -8
- agenta/sdk/litellm/mocks/__init__.py +5 -5
- agenta/sdk/managers/applications.py +304 -0
- agenta/sdk/managers/config.py +2 -2
- agenta/sdk/managers/evaluations.py +0 -0
- agenta/sdk/managers/evaluators.py +303 -0
- agenta/sdk/managers/secrets.py +161 -24
- agenta/sdk/managers/shared.py +3 -1
- agenta/sdk/managers/testsets.py +441 -0
- agenta/sdk/managers/vault.py +3 -3
- agenta/sdk/middleware/auth.py +0 -176
- agenta/sdk/middleware/config.py +27 -9
- agenta/sdk/middleware/vault.py +204 -9
- agenta/sdk/middlewares/__init__.py +0 -0
- agenta/sdk/middlewares/routing/__init__.py +0 -0
- agenta/sdk/middlewares/routing/auth.py +263 -0
- agenta/sdk/middlewares/routing/cors.py +30 -0
- agenta/sdk/middlewares/routing/otel.py +29 -0
- agenta/sdk/middlewares/running/__init__.py +0 -0
- agenta/sdk/middlewares/running/normalizer.py +321 -0
- agenta/sdk/middlewares/running/resolver.py +161 -0
- agenta/sdk/middlewares/running/vault.py +140 -0
- agenta/sdk/models/__init__.py +0 -0
- agenta/sdk/models/blobs.py +33 -0
- agenta/sdk/models/evaluations.py +119 -0
- agenta/sdk/models/git.py +126 -0
- agenta/sdk/models/shared.py +167 -0
- agenta/sdk/models/testsets.py +163 -0
- agenta/sdk/models/tracing.py +202 -0
- agenta/sdk/models/workflows.py +753 -0
- agenta/sdk/tracing/attributes.py +4 -4
- agenta/sdk/tracing/exporters.py +67 -17
- agenta/sdk/tracing/inline.py +37 -45
- agenta/sdk/tracing/processors.py +97 -0
- agenta/sdk/tracing/propagation.py +3 -1
- agenta/sdk/tracing/spans.py +4 -0
- agenta/sdk/tracing/tracing.py +13 -15
- agenta/sdk/types.py +222 -22
- agenta/sdk/utils/cache.py +1 -1
- agenta/sdk/utils/client.py +38 -0
- agenta/sdk/utils/helpers.py +13 -12
- agenta/sdk/utils/logging.py +18 -78
- agenta/sdk/utils/references.py +23 -0
- agenta/sdk/workflows/builtin.py +600 -0
- agenta/sdk/workflows/configurations.py +22 -0
- agenta/sdk/workflows/errors.py +292 -0
- agenta/sdk/workflows/handlers.py +1791 -0
- agenta/sdk/workflows/interfaces.py +948 -0
- agenta/sdk/workflows/sandbox.py +118 -0
- agenta/sdk/workflows/utils.py +303 -6
- {agenta-0.52.6.dist-info → agenta-0.63.2.dist-info}/METADATA +37 -33
- agenta-0.63.2.dist-info/RECORD +421 -0
- {agenta-0.52.6.dist-info → agenta-0.63.2.dist-info}/WHEEL +1 -1
- agenta/sdk/middleware/adapt.py +0 -253
- agenta/sdk/middleware/base.py +0 -40
- agenta/sdk/middleware/flags.py +0 -40
- agenta/sdk/workflows/types.py +0 -472
- agenta-0.52.6.dist-info/RECORD +0 -371
- /agenta/sdk/{workflows → engines/running}/registry.py +0 -0
|
@@ -0,0 +1,753 @@
|
|
|
1
|
+
# /agenta/sdk/models/running.py
|
|
2
|
+
|
|
3
|
+
from typing import Any, Dict, Optional, Union, List
|
|
4
|
+
from uuid import UUID
|
|
5
|
+
from urllib.parse import urlparse
|
|
6
|
+
|
|
7
|
+
from jsonschema.exceptions import SchemaError
|
|
8
|
+
from jsonschema import (
|
|
9
|
+
Draft202012Validator,
|
|
10
|
+
Draft201909Validator,
|
|
11
|
+
Draft7Validator,
|
|
12
|
+
Draft4Validator,
|
|
13
|
+
Draft6Validator,
|
|
14
|
+
)
|
|
15
|
+
from pydantic import (
|
|
16
|
+
BaseModel,
|
|
17
|
+
ConfigDict,
|
|
18
|
+
model_validator,
|
|
19
|
+
ValidationError,
|
|
20
|
+
Field,
|
|
21
|
+
)
|
|
22
|
+
|
|
23
|
+
from agenta.sdk.models.shared import (
|
|
24
|
+
TraceID,
|
|
25
|
+
SpanID,
|
|
26
|
+
Link,
|
|
27
|
+
Identifier,
|
|
28
|
+
Slug,
|
|
29
|
+
Reference,
|
|
30
|
+
Lifecycle,
|
|
31
|
+
Header,
|
|
32
|
+
Metadata,
|
|
33
|
+
Data,
|
|
34
|
+
Schema,
|
|
35
|
+
Status,
|
|
36
|
+
Commit,
|
|
37
|
+
AliasConfig,
|
|
38
|
+
sync_alias,
|
|
39
|
+
)
|
|
40
|
+
|
|
41
|
+
from agenta.sdk.models.git import (
|
|
42
|
+
Artifact,
|
|
43
|
+
ArtifactCreate,
|
|
44
|
+
ArtifactEdit,
|
|
45
|
+
ArtifactQuery,
|
|
46
|
+
ArtifactFork,
|
|
47
|
+
Variant,
|
|
48
|
+
VariantCreate,
|
|
49
|
+
VariantEdit,
|
|
50
|
+
VariantQuery,
|
|
51
|
+
VariantFork,
|
|
52
|
+
Revision,
|
|
53
|
+
RevisionCreate,
|
|
54
|
+
RevisionEdit,
|
|
55
|
+
RevisionQuery,
|
|
56
|
+
RevisionCommit,
|
|
57
|
+
RevisionsLog,
|
|
58
|
+
RevisionFork,
|
|
59
|
+
)
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
# oss.src.core.workflows.dtos
|
|
63
|
+
from typing import Optional, Dict, Any
|
|
64
|
+
from uuid import UUID, uuid4
|
|
65
|
+
from urllib.parse import urlparse
|
|
66
|
+
|
|
67
|
+
from pydantic import (
|
|
68
|
+
BaseModel,
|
|
69
|
+
Field,
|
|
70
|
+
model_validator,
|
|
71
|
+
ValidationError,
|
|
72
|
+
)
|
|
73
|
+
|
|
74
|
+
from jsonschema import (
|
|
75
|
+
Draft202012Validator,
|
|
76
|
+
Draft201909Validator,
|
|
77
|
+
Draft7Validator,
|
|
78
|
+
Draft4Validator,
|
|
79
|
+
Draft6Validator,
|
|
80
|
+
)
|
|
81
|
+
from jsonschema.exceptions import SchemaError
|
|
82
|
+
|
|
83
|
+
|
|
84
|
+
class JsonSchemas(BaseModel):
|
|
85
|
+
parameters: Optional[Schema] = None
|
|
86
|
+
inputs: Optional[Schema] = None
|
|
87
|
+
outputs: Optional[Schema] = None
|
|
88
|
+
|
|
89
|
+
|
|
90
|
+
class WorkflowFlags(BaseModel):
|
|
91
|
+
is_custom: bool = False
|
|
92
|
+
is_evaluator: bool = False
|
|
93
|
+
is_human: bool = False
|
|
94
|
+
|
|
95
|
+
|
|
96
|
+
class WorkflowServiceInterface(BaseModel):
|
|
97
|
+
version: str = "2025.07.14"
|
|
98
|
+
|
|
99
|
+
uri: Optional[str] = None
|
|
100
|
+
url: Optional[str] = None
|
|
101
|
+
headers: Optional[Dict[str, Union[str, Reference]]] = None
|
|
102
|
+
schemas: Optional[JsonSchemas] = None
|
|
103
|
+
|
|
104
|
+
@model_validator(mode="after")
|
|
105
|
+
def validate_jsonschemas_and_url(self) -> "WorkflowServiceInterface":
|
|
106
|
+
errors = []
|
|
107
|
+
|
|
108
|
+
if self.schemas:
|
|
109
|
+
for key, schema in self.schemas.model_dump().items():
|
|
110
|
+
try:
|
|
111
|
+
if not schema:
|
|
112
|
+
continue
|
|
113
|
+
|
|
114
|
+
validator_class = self._get_validator_class_from_schema(schema)
|
|
115
|
+
validator_class.check_schema(schema)
|
|
116
|
+
except SchemaError as e:
|
|
117
|
+
errors.append(
|
|
118
|
+
{
|
|
119
|
+
"loc": ("schemas", key),
|
|
120
|
+
"msg": f"Invalid JSON Schema: {e.message}",
|
|
121
|
+
"type": "value_error.jsonschema",
|
|
122
|
+
"ctx": {"error": str(e)},
|
|
123
|
+
"input": schema,
|
|
124
|
+
}
|
|
125
|
+
)
|
|
126
|
+
|
|
127
|
+
if self.url:
|
|
128
|
+
if not self._is_valid_http_url(self.url):
|
|
129
|
+
errors.append(
|
|
130
|
+
{
|
|
131
|
+
"loc": ("url",),
|
|
132
|
+
"msg": "Invalid HTTP(S) URL",
|
|
133
|
+
"type": "value_error.url",
|
|
134
|
+
"ctx": {"error": "Invalid URL format"},
|
|
135
|
+
"input": self.url,
|
|
136
|
+
}
|
|
137
|
+
)
|
|
138
|
+
|
|
139
|
+
if errors:
|
|
140
|
+
raise ValidationError.from_exception_data(
|
|
141
|
+
self.__class__.__name__,
|
|
142
|
+
errors, # type: ignore
|
|
143
|
+
)
|
|
144
|
+
|
|
145
|
+
return self
|
|
146
|
+
|
|
147
|
+
@staticmethod
|
|
148
|
+
def _get_validator_class_from_schema(schema: Dict[str, Any]):
|
|
149
|
+
"""Detect JSON Schema draft from $schema or fallback to 2020-12."""
|
|
150
|
+
schema_uri = schema.get(
|
|
151
|
+
"$schema", "https://json-schema.org/draft/2020-12/schema"
|
|
152
|
+
)
|
|
153
|
+
if "2020-12" in schema_uri:
|
|
154
|
+
return Draft202012Validator
|
|
155
|
+
elif "2019-09" in schema_uri:
|
|
156
|
+
return Draft201909Validator
|
|
157
|
+
elif "draft-07" in schema_uri:
|
|
158
|
+
return Draft7Validator
|
|
159
|
+
elif "draft-06" in schema_uri:
|
|
160
|
+
return Draft6Validator
|
|
161
|
+
elif "draft-04" in schema_uri:
|
|
162
|
+
return Draft4Validator
|
|
163
|
+
else:
|
|
164
|
+
return Draft202012Validator
|
|
165
|
+
|
|
166
|
+
@staticmethod
|
|
167
|
+
def _is_valid_http_url(url: str) -> bool:
|
|
168
|
+
parsed = urlparse(url)
|
|
169
|
+
return parsed.scheme in ("http", "https") and bool(parsed.netloc)
|
|
170
|
+
|
|
171
|
+
|
|
172
|
+
class WorkflowServiceConfiguration(BaseModel):
|
|
173
|
+
script: Optional[Data] = None
|
|
174
|
+
parameters: Optional[Data] = None
|
|
175
|
+
|
|
176
|
+
|
|
177
|
+
class WorkflowRevisionData(
|
|
178
|
+
WorkflowServiceInterface,
|
|
179
|
+
WorkflowServiceConfiguration,
|
|
180
|
+
):
|
|
181
|
+
pass
|
|
182
|
+
|
|
183
|
+
|
|
184
|
+
class WorkflowServiceStatus(Status):
|
|
185
|
+
type: Optional[str] = None
|
|
186
|
+
stacktrace: Optional[Union[list[str], str]] = None
|
|
187
|
+
|
|
188
|
+
|
|
189
|
+
class WorkflowServiceRequestData(BaseModel):
|
|
190
|
+
revision: Optional[dict] = None
|
|
191
|
+
parameters: Optional[dict] = None
|
|
192
|
+
#
|
|
193
|
+
testcase: Optional[dict] = None
|
|
194
|
+
inputs: Optional[dict] = None
|
|
195
|
+
#
|
|
196
|
+
trace: Optional[dict] = None
|
|
197
|
+
outputs: Optional[Any] = None
|
|
198
|
+
|
|
199
|
+
|
|
200
|
+
class WorkflowServiceResponseData(BaseModel):
|
|
201
|
+
outputs: Optional[Any] = None
|
|
202
|
+
|
|
203
|
+
|
|
204
|
+
class WorkflowServiceBaseRequest(Metadata):
|
|
205
|
+
version: str = "2025.07.14"
|
|
206
|
+
|
|
207
|
+
interface: Optional[Union[WorkflowServiceInterface, Dict[str, Any]]] = None
|
|
208
|
+
configuration: Optional[Union[WorkflowServiceConfiguration, Dict[str, Any]]] = None
|
|
209
|
+
|
|
210
|
+
references: Optional[Dict[str, Union[Reference, Dict[str, Any]]]] = None
|
|
211
|
+
links: Optional[Dict[str, Union[Link, Dict[str, Any]]]] = None
|
|
212
|
+
|
|
213
|
+
secrets: Optional[Dict[str, Any]] = None
|
|
214
|
+
credentials: Optional[str] = None
|
|
215
|
+
|
|
216
|
+
@model_validator(mode="before")
|
|
217
|
+
def _coerce_nested_models(cls, values: Dict[str, Any]) -> Dict[str, Any]:
|
|
218
|
+
"""Convert dicts into their respective Pydantic models."""
|
|
219
|
+
if "interface" in values and isinstance(values["interface"], dict):
|
|
220
|
+
values["interface"] = WorkflowServiceInterface(**values["interface"])
|
|
221
|
+
|
|
222
|
+
if "configuration" in values and isinstance(values["configuration"], dict):
|
|
223
|
+
values["configuration"] = WorkflowServiceConfiguration(
|
|
224
|
+
**values["configuration"]
|
|
225
|
+
)
|
|
226
|
+
|
|
227
|
+
if "references" in values and isinstance(values["references"], dict):
|
|
228
|
+
values["references"] = {
|
|
229
|
+
k: (Reference(**v) if isinstance(v, dict) else v)
|
|
230
|
+
for k, v in values["references"].items()
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
if "links" in values and isinstance(values["links"], dict):
|
|
234
|
+
values["links"] = {
|
|
235
|
+
k: (Link(**v) if isinstance(v, dict) else v)
|
|
236
|
+
for k, v in values["links"].items()
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
return values
|
|
240
|
+
|
|
241
|
+
|
|
242
|
+
class WorkflowServiceRequest(WorkflowServiceBaseRequest):
|
|
243
|
+
data: Optional[WorkflowServiceRequestData] = None
|
|
244
|
+
|
|
245
|
+
|
|
246
|
+
class WorkflowServiceBaseResponse(TraceID, SpanID):
|
|
247
|
+
version: str = "2025.07.14"
|
|
248
|
+
|
|
249
|
+
status: Optional[WorkflowServiceStatus] = WorkflowServiceStatus()
|
|
250
|
+
|
|
251
|
+
|
|
252
|
+
class WorkflowServiceBatchResponse(WorkflowServiceBaseResponse):
|
|
253
|
+
data: Optional[WorkflowServiceResponseData] = None
|
|
254
|
+
|
|
255
|
+
|
|
256
|
+
class WorkflowServiceStreamResponse(WorkflowServiceBaseResponse):
|
|
257
|
+
generator: Any # Callable[[], AsyncGenerator[Any, None]]
|
|
258
|
+
|
|
259
|
+
model_config = ConfigDict(arbitrary_types_allowed=True)
|
|
260
|
+
|
|
261
|
+
async def iterator(self):
|
|
262
|
+
async for item in self.generator():
|
|
263
|
+
yield item
|
|
264
|
+
|
|
265
|
+
|
|
266
|
+
WorkflowServiceResponse = Union[
|
|
267
|
+
WorkflowServiceBatchResponse,
|
|
268
|
+
WorkflowServiceStreamResponse,
|
|
269
|
+
]
|
|
270
|
+
|
|
271
|
+
|
|
272
|
+
# aliases ----------------------------------------------------------------------
|
|
273
|
+
|
|
274
|
+
|
|
275
|
+
class WorkflowIdAlias(AliasConfig):
|
|
276
|
+
workflow_id: Optional[UUID] = None
|
|
277
|
+
artifact_id: Optional[UUID] = Field(
|
|
278
|
+
default=None,
|
|
279
|
+
exclude=True,
|
|
280
|
+
alias="workflow_id",
|
|
281
|
+
)
|
|
282
|
+
|
|
283
|
+
|
|
284
|
+
class WorkflowVariantIdAlias(AliasConfig):
|
|
285
|
+
workflow_variant_id: Optional[UUID] = None
|
|
286
|
+
variant_id: Optional[UUID] = Field(
|
|
287
|
+
default=None,
|
|
288
|
+
exclude=True,
|
|
289
|
+
alias="workflow_variant_id",
|
|
290
|
+
)
|
|
291
|
+
|
|
292
|
+
|
|
293
|
+
class WorkflowRevisionIdAlias(AliasConfig):
|
|
294
|
+
workflow_revision_id: Optional[UUID] = None
|
|
295
|
+
revision_id: Optional[UUID] = Field(
|
|
296
|
+
default=None,
|
|
297
|
+
exclude=True,
|
|
298
|
+
alias="workflow_revision_id",
|
|
299
|
+
)
|
|
300
|
+
|
|
301
|
+
|
|
302
|
+
# workflows --------------------------------------------------------------------
|
|
303
|
+
|
|
304
|
+
|
|
305
|
+
class Workflow(Artifact):
|
|
306
|
+
flags: Optional[WorkflowFlags] = None
|
|
307
|
+
|
|
308
|
+
|
|
309
|
+
class WorkflowCreate(ArtifactCreate):
|
|
310
|
+
flags: Optional[WorkflowFlags] = None
|
|
311
|
+
|
|
312
|
+
|
|
313
|
+
class WorkflowEdit(ArtifactEdit):
|
|
314
|
+
flags: Optional[WorkflowFlags] = None
|
|
315
|
+
|
|
316
|
+
|
|
317
|
+
# workflow variants ------------------------------------------------------------
|
|
318
|
+
|
|
319
|
+
|
|
320
|
+
class WorkflowVariant(
|
|
321
|
+
Variant,
|
|
322
|
+
WorkflowIdAlias,
|
|
323
|
+
):
|
|
324
|
+
flags: Optional[WorkflowFlags] = None
|
|
325
|
+
|
|
326
|
+
def model_post_init(self, __context) -> None:
|
|
327
|
+
sync_alias("workflow_id", "artifact_id", self)
|
|
328
|
+
|
|
329
|
+
|
|
330
|
+
class WorkflowVariantCreate(
|
|
331
|
+
VariantCreate,
|
|
332
|
+
WorkflowIdAlias,
|
|
333
|
+
):
|
|
334
|
+
flags: Optional[WorkflowFlags] = None
|
|
335
|
+
|
|
336
|
+
def model_post_init(self, __context) -> None:
|
|
337
|
+
sync_alias("workflow_id", "artifact_id", self)
|
|
338
|
+
|
|
339
|
+
|
|
340
|
+
class WorkflowVariantEdit(VariantEdit):
|
|
341
|
+
flags: Optional[WorkflowFlags] = None
|
|
342
|
+
|
|
343
|
+
|
|
344
|
+
class WorkflowVariantQuery(VariantQuery):
|
|
345
|
+
flags: Optional[WorkflowFlags] = None
|
|
346
|
+
|
|
347
|
+
|
|
348
|
+
# workflow revisions -----------------------------------------------------------
|
|
349
|
+
|
|
350
|
+
from agenta.sdk.models.workflows import WorkflowRevisionData
|
|
351
|
+
|
|
352
|
+
|
|
353
|
+
class WorkflowRevision(
|
|
354
|
+
Revision,
|
|
355
|
+
WorkflowIdAlias,
|
|
356
|
+
WorkflowVariantIdAlias,
|
|
357
|
+
):
|
|
358
|
+
flags: Optional[WorkflowFlags] = None
|
|
359
|
+
|
|
360
|
+
data: Optional[WorkflowRevisionData] = None
|
|
361
|
+
|
|
362
|
+
def model_post_init(self, __context) -> None:
|
|
363
|
+
sync_alias("workflow_id", "artifact_id", self)
|
|
364
|
+
sync_alias("workflow_variant_id", "variant_id", self)
|
|
365
|
+
|
|
366
|
+
|
|
367
|
+
class WorkflowRevisionCreate(
|
|
368
|
+
RevisionCreate,
|
|
369
|
+
WorkflowIdAlias,
|
|
370
|
+
WorkflowVariantIdAlias,
|
|
371
|
+
):
|
|
372
|
+
flags: Optional[WorkflowFlags] = None
|
|
373
|
+
|
|
374
|
+
def model_post_init(self, __context) -> None:
|
|
375
|
+
sync_alias("workflow_id", "artifact_id", self)
|
|
376
|
+
sync_alias("workflow_variant_id", "variant_id", self)
|
|
377
|
+
|
|
378
|
+
|
|
379
|
+
class WorkflowRevisionEdit(RevisionEdit):
|
|
380
|
+
flags: Optional[WorkflowFlags] = None
|
|
381
|
+
|
|
382
|
+
|
|
383
|
+
class WorkflowRevisionQuery(RevisionQuery):
|
|
384
|
+
flags: Optional[WorkflowFlags] = None
|
|
385
|
+
|
|
386
|
+
|
|
387
|
+
class WorkflowRevisionCommit(
|
|
388
|
+
RevisionCommit,
|
|
389
|
+
WorkflowIdAlias,
|
|
390
|
+
WorkflowVariantIdAlias,
|
|
391
|
+
):
|
|
392
|
+
flags: Optional[WorkflowFlags] = None
|
|
393
|
+
|
|
394
|
+
data: Optional[WorkflowRevisionData] = None
|
|
395
|
+
|
|
396
|
+
def model_post_init(self, __context) -> None:
|
|
397
|
+
sync_alias("workflow_id", "artifact_id", self)
|
|
398
|
+
sync_alias("workflow_variant_id", "variant_id", self)
|
|
399
|
+
|
|
400
|
+
|
|
401
|
+
class WorkflowRevisionsLog(
|
|
402
|
+
RevisionsLog,
|
|
403
|
+
WorkflowIdAlias,
|
|
404
|
+
WorkflowVariantIdAlias,
|
|
405
|
+
WorkflowRevisionIdAlias,
|
|
406
|
+
):
|
|
407
|
+
def model_post_init(self, __context) -> None:
|
|
408
|
+
sync_alias("workflow_id", "artifact_id", self)
|
|
409
|
+
sync_alias("workflow_variant_id", "variant_id", self)
|
|
410
|
+
sync_alias("workflow_revision_id", "revision_id", self)
|
|
411
|
+
|
|
412
|
+
|
|
413
|
+
# forks ------------------------------------------------------------------------
|
|
414
|
+
|
|
415
|
+
|
|
416
|
+
class WorkflowRevisionFork(RevisionFork):
|
|
417
|
+
flags: Optional[WorkflowFlags] = None
|
|
418
|
+
|
|
419
|
+
data: Optional[WorkflowRevisionData] = None
|
|
420
|
+
|
|
421
|
+
|
|
422
|
+
class WorkflowRevisionForkAlias(AliasConfig):
|
|
423
|
+
workflow_revision: Optional[WorkflowRevisionFork] = None
|
|
424
|
+
|
|
425
|
+
revision: Optional[RevisionFork] = Field(
|
|
426
|
+
default=None,
|
|
427
|
+
exclude=True,
|
|
428
|
+
alias="workflow_revision",
|
|
429
|
+
)
|
|
430
|
+
|
|
431
|
+
|
|
432
|
+
class WorkflowVariantFork(VariantFork):
|
|
433
|
+
flags: Optional[WorkflowFlags] = None
|
|
434
|
+
|
|
435
|
+
|
|
436
|
+
class WorkflowVariantForkAlias(AliasConfig):
|
|
437
|
+
workflow_variant: Optional[WorkflowVariantFork] = None
|
|
438
|
+
|
|
439
|
+
variant: Optional[VariantFork] = Field(
|
|
440
|
+
default=None,
|
|
441
|
+
exclude=True,
|
|
442
|
+
alias="workflow_variant",
|
|
443
|
+
)
|
|
444
|
+
|
|
445
|
+
|
|
446
|
+
class WorkflowFork(
|
|
447
|
+
ArtifactFork,
|
|
448
|
+
WorkflowIdAlias,
|
|
449
|
+
WorkflowVariantIdAlias,
|
|
450
|
+
WorkflowVariantForkAlias,
|
|
451
|
+
WorkflowRevisionIdAlias,
|
|
452
|
+
WorkflowRevisionForkAlias,
|
|
453
|
+
):
|
|
454
|
+
def model_post_init(self, __context) -> None:
|
|
455
|
+
sync_alias("workflow_id", "artifact_id", self)
|
|
456
|
+
sync_alias("workflow_variant_id", "variant_id", self)
|
|
457
|
+
sync_alias("workflow_variant", "variant", self)
|
|
458
|
+
sync_alias("workflow_revision_id", "revision_id", self)
|
|
459
|
+
sync_alias("workflow_revision", "revision", self)
|
|
460
|
+
|
|
461
|
+
|
|
462
|
+
# ------------------------------------------------------------------------------
|
|
463
|
+
|
|
464
|
+
|
|
465
|
+
class EvaluatorRevision(BaseModel):
|
|
466
|
+
id: Optional[UUID] = None
|
|
467
|
+
slug: Optional[str] = None
|
|
468
|
+
version: Optional[str] = None
|
|
469
|
+
|
|
470
|
+
data: Optional[WorkflowRevisionData] = None
|
|
471
|
+
|
|
472
|
+
evaluator_id: Optional[UUID] = None
|
|
473
|
+
evaluator_variant_id: Optional[UUID] = None
|
|
474
|
+
|
|
475
|
+
|
|
476
|
+
class ApplicationServiceRequest(WorkflowServiceRequest):
|
|
477
|
+
pass
|
|
478
|
+
|
|
479
|
+
|
|
480
|
+
class ApplicationServiceBatchResponse(WorkflowServiceBatchResponse):
|
|
481
|
+
pass
|
|
482
|
+
|
|
483
|
+
|
|
484
|
+
class EvaluatorServiceRequest(WorkflowServiceRequest):
|
|
485
|
+
pass
|
|
486
|
+
|
|
487
|
+
|
|
488
|
+
class EvaluatorServiceBatchResponse(WorkflowServiceBatchResponse):
|
|
489
|
+
pass
|
|
490
|
+
|
|
491
|
+
|
|
492
|
+
# oss.src.core.evaluators.dtos
|
|
493
|
+
|
|
494
|
+
|
|
495
|
+
class EvaluatorIdAlias(AliasConfig):
|
|
496
|
+
evaluator_id: Optional[UUID] = None
|
|
497
|
+
workflow_id: Optional[UUID] = Field(
|
|
498
|
+
default=None,
|
|
499
|
+
exclude=True,
|
|
500
|
+
alias="evaluator_id",
|
|
501
|
+
)
|
|
502
|
+
|
|
503
|
+
|
|
504
|
+
class EvaluatorVariantIdAlias(AliasConfig):
|
|
505
|
+
evaluator_variant_id: Optional[UUID] = None
|
|
506
|
+
workflow_variant_id: Optional[UUID] = Field(
|
|
507
|
+
default=None,
|
|
508
|
+
exclude=True,
|
|
509
|
+
alias="evaluator_variant_id",
|
|
510
|
+
)
|
|
511
|
+
|
|
512
|
+
|
|
513
|
+
class EvaluatorRevisionData(WorkflowRevisionData):
|
|
514
|
+
pass
|
|
515
|
+
|
|
516
|
+
|
|
517
|
+
class EvaluatorFlags(WorkflowFlags):
|
|
518
|
+
def __init__(self, **data):
|
|
519
|
+
data["is_evaluator"] = True
|
|
520
|
+
|
|
521
|
+
super().__init__(**data)
|
|
522
|
+
|
|
523
|
+
|
|
524
|
+
class SimpleEvaluatorFlags(EvaluatorFlags):
|
|
525
|
+
pass
|
|
526
|
+
|
|
527
|
+
|
|
528
|
+
class SimpleEvaluatorData(EvaluatorRevisionData):
|
|
529
|
+
pass
|
|
530
|
+
|
|
531
|
+
|
|
532
|
+
class Evaluator(Workflow):
|
|
533
|
+
flags: Optional[EvaluatorFlags] = None
|
|
534
|
+
|
|
535
|
+
|
|
536
|
+
class SimpleEvaluatorRevision(
|
|
537
|
+
WorkflowRevision,
|
|
538
|
+
EvaluatorIdAlias,
|
|
539
|
+
EvaluatorVariantIdAlias,
|
|
540
|
+
):
|
|
541
|
+
flags: Optional[EvaluatorFlags] = None
|
|
542
|
+
|
|
543
|
+
data: Optional[EvaluatorRevisionData] = None
|
|
544
|
+
|
|
545
|
+
|
|
546
|
+
class SimpleEvaluator(Identifier, Slug, Lifecycle, Header, Metadata):
|
|
547
|
+
flags: Optional[SimpleEvaluatorFlags] = None
|
|
548
|
+
|
|
549
|
+
data: Optional[SimpleEvaluatorData] = None
|
|
550
|
+
|
|
551
|
+
|
|
552
|
+
class SimpleEvaluatorCreate(Slug, Header, Metadata):
|
|
553
|
+
flags: Optional[SimpleEvaluatorFlags] = None
|
|
554
|
+
|
|
555
|
+
data: Optional[SimpleEvaluatorData] = None
|
|
556
|
+
|
|
557
|
+
|
|
558
|
+
class SimpleEvaluatorEdit(Identifier, Header, Metadata):
|
|
559
|
+
flags: Optional[SimpleEvaluatorFlags] = None
|
|
560
|
+
|
|
561
|
+
data: Optional[SimpleEvaluatorData] = None
|
|
562
|
+
|
|
563
|
+
|
|
564
|
+
class SimpleEvaluatorResponse(BaseModel):
|
|
565
|
+
count: int = 0
|
|
566
|
+
evaluator: Optional[SimpleEvaluator] = None
|
|
567
|
+
|
|
568
|
+
|
|
569
|
+
class EvaluatorRevisionResponse(BaseModel):
|
|
570
|
+
count: int = 0
|
|
571
|
+
evaluator_revision: Optional[EvaluatorRevision] = None
|
|
572
|
+
|
|
573
|
+
|
|
574
|
+
# oss.src.core.applications.dtos
|
|
575
|
+
|
|
576
|
+
# aliases ----------------------------------------------------------------------
|
|
577
|
+
|
|
578
|
+
|
|
579
|
+
class ApplicationIdAlias(AliasConfig):
|
|
580
|
+
application_id: Optional[UUID] = None
|
|
581
|
+
workflow_id: Optional[UUID] = Field(
|
|
582
|
+
default=None,
|
|
583
|
+
exclude=True,
|
|
584
|
+
alias="application_id",
|
|
585
|
+
)
|
|
586
|
+
|
|
587
|
+
|
|
588
|
+
class ApplicationVariantIdAlias(AliasConfig):
|
|
589
|
+
application_variant_id: Optional[UUID] = None
|
|
590
|
+
workflow_variant_id: Optional[UUID] = Field(
|
|
591
|
+
default=None,
|
|
592
|
+
exclude=True,
|
|
593
|
+
alias="application_variant_id",
|
|
594
|
+
)
|
|
595
|
+
|
|
596
|
+
|
|
597
|
+
class ApplicationRevisionIdAlias(AliasConfig):
|
|
598
|
+
application_revision_id: Optional[UUID] = None
|
|
599
|
+
workflow_revision_id: Optional[UUID] = Field(
|
|
600
|
+
default=None,
|
|
601
|
+
exclude=True,
|
|
602
|
+
alias="application_revision_id",
|
|
603
|
+
)
|
|
604
|
+
|
|
605
|
+
|
|
606
|
+
# globals ----------------------------------------------------------------------
|
|
607
|
+
|
|
608
|
+
|
|
609
|
+
class ApplicationFlags(WorkflowFlags):
|
|
610
|
+
def __init__(self, **data):
|
|
611
|
+
data["is_evaluator"] = False
|
|
612
|
+
|
|
613
|
+
super().__init__(**data)
|
|
614
|
+
|
|
615
|
+
|
|
616
|
+
# applications -------------------------------------------------------------------
|
|
617
|
+
|
|
618
|
+
|
|
619
|
+
class Application(Workflow):
|
|
620
|
+
flags: Optional[ApplicationFlags] = None
|
|
621
|
+
|
|
622
|
+
|
|
623
|
+
class ApplicationCreate(WorkflowCreate):
|
|
624
|
+
flags: Optional[ApplicationFlags] = None
|
|
625
|
+
|
|
626
|
+
|
|
627
|
+
class ApplicationEdit(WorkflowEdit):
|
|
628
|
+
flags: Optional[ApplicationFlags] = None
|
|
629
|
+
|
|
630
|
+
|
|
631
|
+
# application variants -----------------------------------------------------------
|
|
632
|
+
|
|
633
|
+
|
|
634
|
+
class ApplicationVariant(
|
|
635
|
+
WorkflowVariant,
|
|
636
|
+
ApplicationIdAlias,
|
|
637
|
+
):
|
|
638
|
+
flags: Optional[ApplicationFlags] = None
|
|
639
|
+
|
|
640
|
+
def model_post_init(self, __context) -> None:
|
|
641
|
+
sync_alias("application_id", "workflow_id", self)
|
|
642
|
+
|
|
643
|
+
|
|
644
|
+
class ApplicationVariantCreate(
|
|
645
|
+
WorkflowVariantCreate,
|
|
646
|
+
ApplicationIdAlias,
|
|
647
|
+
):
|
|
648
|
+
flags: Optional[ApplicationFlags] = None
|
|
649
|
+
|
|
650
|
+
def model_post_init(self, __context) -> None:
|
|
651
|
+
sync_alias("application_id", "workflow_id", self)
|
|
652
|
+
|
|
653
|
+
|
|
654
|
+
class ApplicationVariantEdit(WorkflowVariantEdit):
|
|
655
|
+
flags: Optional[ApplicationFlags] = None
|
|
656
|
+
|
|
657
|
+
|
|
658
|
+
# application revisions -----------------------------------------------------
|
|
659
|
+
|
|
660
|
+
|
|
661
|
+
class ApplicationRevisionData(WorkflowRevisionData):
|
|
662
|
+
pass
|
|
663
|
+
|
|
664
|
+
|
|
665
|
+
class ApplicationRevision(
|
|
666
|
+
WorkflowRevision,
|
|
667
|
+
ApplicationIdAlias,
|
|
668
|
+
ApplicationVariantIdAlias,
|
|
669
|
+
):
|
|
670
|
+
flags: Optional[ApplicationFlags] = None
|
|
671
|
+
|
|
672
|
+
data: Optional[ApplicationRevisionData] = None
|
|
673
|
+
|
|
674
|
+
def model_post_init(self, __context) -> None:
|
|
675
|
+
sync_alias("application_id", "workflow_id", self)
|
|
676
|
+
sync_alias("application_variant_id", "workflow_variant_id", self)
|
|
677
|
+
|
|
678
|
+
|
|
679
|
+
class ApplicationRevisionCreate(
|
|
680
|
+
WorkflowRevisionCreate,
|
|
681
|
+
ApplicationIdAlias,
|
|
682
|
+
ApplicationVariantIdAlias,
|
|
683
|
+
):
|
|
684
|
+
flags: Optional[ApplicationFlags] = None
|
|
685
|
+
|
|
686
|
+
def model_post_init(self, __context) -> None:
|
|
687
|
+
sync_alias("application_id", "workflow_id", self)
|
|
688
|
+
sync_alias("application_variant_id", "workflow_variant_id", self)
|
|
689
|
+
|
|
690
|
+
|
|
691
|
+
class ApplicationRevisionEdit(WorkflowRevisionEdit):
|
|
692
|
+
flags: Optional[ApplicationFlags] = None
|
|
693
|
+
|
|
694
|
+
|
|
695
|
+
class ApplicationRevisionCommit(
|
|
696
|
+
WorkflowRevisionCommit,
|
|
697
|
+
ApplicationIdAlias,
|
|
698
|
+
ApplicationVariantIdAlias,
|
|
699
|
+
):
|
|
700
|
+
flags: Optional[ApplicationFlags] = None
|
|
701
|
+
|
|
702
|
+
data: Optional[ApplicationRevisionData] = None
|
|
703
|
+
|
|
704
|
+
def model_post_init(self, __context) -> None:
|
|
705
|
+
sync_alias("application_id", "workflow_id", self)
|
|
706
|
+
sync_alias("application_variant_id", "workflow_variant_id", self)
|
|
707
|
+
|
|
708
|
+
|
|
709
|
+
class ApplicationRevisionResponse(BaseModel):
|
|
710
|
+
count: int = 0
|
|
711
|
+
application_revision: Optional[ApplicationRevision] = None
|
|
712
|
+
|
|
713
|
+
|
|
714
|
+
class ApplicationRevisionsResponse(BaseModel):
|
|
715
|
+
count: int = 0
|
|
716
|
+
application_revisions: List[ApplicationRevision] = []
|
|
717
|
+
|
|
718
|
+
|
|
719
|
+
# simple applications ------------------------------------------------------------
|
|
720
|
+
|
|
721
|
+
|
|
722
|
+
class LegacyApplicationFlags(WorkflowFlags):
|
|
723
|
+
pass
|
|
724
|
+
|
|
725
|
+
|
|
726
|
+
class LegacyApplicationData(WorkflowRevisionData):
|
|
727
|
+
pass
|
|
728
|
+
|
|
729
|
+
|
|
730
|
+
class LegacyApplication(Identifier, Slug, Lifecycle, Header, Metadata):
|
|
731
|
+
flags: Optional[LegacyApplicationFlags] = None
|
|
732
|
+
|
|
733
|
+
data: Optional[LegacyApplicationData] = None
|
|
734
|
+
|
|
735
|
+
|
|
736
|
+
class LegacyApplicationCreate(Slug, Header, Metadata):
|
|
737
|
+
flags: Optional[LegacyApplicationFlags] = None
|
|
738
|
+
|
|
739
|
+
data: Optional[LegacyApplicationData] = None
|
|
740
|
+
|
|
741
|
+
|
|
742
|
+
class LegacyApplicationEdit(Identifier, Header, Metadata):
|
|
743
|
+
flags: Optional[LegacyApplicationFlags] = None
|
|
744
|
+
|
|
745
|
+
data: Optional[LegacyApplicationData] = None
|
|
746
|
+
|
|
747
|
+
|
|
748
|
+
class LegacyApplicationResponse(BaseModel):
|
|
749
|
+
count: int = 0
|
|
750
|
+
application: Optional[LegacyApplication] = None
|
|
751
|
+
|
|
752
|
+
|
|
753
|
+
# end of oss.src.core.applications.dtos
|