julee 0.1.0__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.
- julee/__init__.py +3 -0
- julee/api/__init__.py +20 -0
- julee/api/app.py +180 -0
- julee/api/dependencies.py +257 -0
- julee/api/requests.py +175 -0
- julee/api/responses.py +43 -0
- julee/api/routers/__init__.py +43 -0
- julee/api/routers/assembly_specifications.py +212 -0
- julee/api/routers/documents.py +182 -0
- julee/api/routers/knowledge_service_configs.py +79 -0
- julee/api/routers/knowledge_service_queries.py +293 -0
- julee/api/routers/system.py +137 -0
- julee/api/routers/workflows.py +234 -0
- julee/api/services/__init__.py +20 -0
- julee/api/services/system_initialization.py +214 -0
- julee/api/tests/__init__.py +14 -0
- julee/api/tests/routers/__init__.py +17 -0
- julee/api/tests/routers/test_assembly_specifications.py +749 -0
- julee/api/tests/routers/test_documents.py +301 -0
- julee/api/tests/routers/test_knowledge_service_configs.py +234 -0
- julee/api/tests/routers/test_knowledge_service_queries.py +738 -0
- julee/api/tests/routers/test_system.py +179 -0
- julee/api/tests/routers/test_workflows.py +393 -0
- julee/api/tests/test_app.py +285 -0
- julee/api/tests/test_dependencies.py +245 -0
- julee/api/tests/test_requests.py +250 -0
- julee/domain/__init__.py +22 -0
- julee/domain/models/__init__.py +49 -0
- julee/domain/models/assembly/__init__.py +17 -0
- julee/domain/models/assembly/assembly.py +103 -0
- julee/domain/models/assembly/tests/__init__.py +0 -0
- julee/domain/models/assembly/tests/factories.py +37 -0
- julee/domain/models/assembly/tests/test_assembly.py +430 -0
- julee/domain/models/assembly_specification/__init__.py +24 -0
- julee/domain/models/assembly_specification/assembly_specification.py +172 -0
- julee/domain/models/assembly_specification/knowledge_service_query.py +123 -0
- julee/domain/models/assembly_specification/tests/__init__.py +0 -0
- julee/domain/models/assembly_specification/tests/factories.py +78 -0
- julee/domain/models/assembly_specification/tests/test_assembly_specification.py +490 -0
- julee/domain/models/assembly_specification/tests/test_knowledge_service_query.py +310 -0
- julee/domain/models/custom_fields/__init__.py +0 -0
- julee/domain/models/custom_fields/content_stream.py +68 -0
- julee/domain/models/custom_fields/tests/__init__.py +0 -0
- julee/domain/models/custom_fields/tests/test_custom_fields.py +53 -0
- julee/domain/models/document/__init__.py +17 -0
- julee/domain/models/document/document.py +150 -0
- julee/domain/models/document/tests/__init__.py +0 -0
- julee/domain/models/document/tests/factories.py +76 -0
- julee/domain/models/document/tests/test_document.py +297 -0
- julee/domain/models/knowledge_service_config/__init__.py +17 -0
- julee/domain/models/knowledge_service_config/knowledge_service_config.py +86 -0
- julee/domain/models/policy/__init__.py +15 -0
- julee/domain/models/policy/document_policy_validation.py +220 -0
- julee/domain/models/policy/policy.py +203 -0
- julee/domain/models/policy/tests/__init__.py +0 -0
- julee/domain/models/policy/tests/factories.py +47 -0
- julee/domain/models/policy/tests/test_document_policy_validation.py +420 -0
- julee/domain/models/policy/tests/test_policy.py +546 -0
- julee/domain/repositories/__init__.py +27 -0
- julee/domain/repositories/assembly.py +45 -0
- julee/domain/repositories/assembly_specification.py +52 -0
- julee/domain/repositories/base.py +146 -0
- julee/domain/repositories/document.py +49 -0
- julee/domain/repositories/document_policy_validation.py +52 -0
- julee/domain/repositories/knowledge_service_config.py +54 -0
- julee/domain/repositories/knowledge_service_query.py +44 -0
- julee/domain/repositories/policy.py +49 -0
- julee/domain/use_cases/__init__.py +17 -0
- julee/domain/use_cases/decorators.py +107 -0
- julee/domain/use_cases/extract_assemble_data.py +649 -0
- julee/domain/use_cases/initialize_system_data.py +842 -0
- julee/domain/use_cases/tests/__init__.py +7 -0
- julee/domain/use_cases/tests/test_extract_assemble_data.py +548 -0
- julee/domain/use_cases/tests/test_initialize_system_data.py +455 -0
- julee/domain/use_cases/tests/test_validate_document.py +1228 -0
- julee/domain/use_cases/validate_document.py +736 -0
- julee/fixtures/assembly_specifications.yaml +70 -0
- julee/fixtures/documents.yaml +178 -0
- julee/fixtures/knowledge_service_configs.yaml +37 -0
- julee/fixtures/knowledge_service_queries.yaml +27 -0
- julee/repositories/__init__.py +17 -0
- julee/repositories/memory/__init__.py +31 -0
- julee/repositories/memory/assembly.py +84 -0
- julee/repositories/memory/assembly_specification.py +125 -0
- julee/repositories/memory/base.py +227 -0
- julee/repositories/memory/document.py +149 -0
- julee/repositories/memory/document_policy_validation.py +104 -0
- julee/repositories/memory/knowledge_service_config.py +123 -0
- julee/repositories/memory/knowledge_service_query.py +120 -0
- julee/repositories/memory/policy.py +87 -0
- julee/repositories/memory/tests/__init__.py +0 -0
- julee/repositories/memory/tests/test_document.py +212 -0
- julee/repositories/memory/tests/test_document_policy_validation.py +161 -0
- julee/repositories/memory/tests/test_policy.py +443 -0
- julee/repositories/minio/__init__.py +31 -0
- julee/repositories/minio/assembly.py +103 -0
- julee/repositories/minio/assembly_specification.py +170 -0
- julee/repositories/minio/client.py +570 -0
- julee/repositories/minio/document.py +530 -0
- julee/repositories/minio/document_policy_validation.py +120 -0
- julee/repositories/minio/knowledge_service_config.py +187 -0
- julee/repositories/minio/knowledge_service_query.py +211 -0
- julee/repositories/minio/policy.py +106 -0
- julee/repositories/minio/tests/__init__.py +0 -0
- julee/repositories/minio/tests/fake_client.py +213 -0
- julee/repositories/minio/tests/test_assembly.py +374 -0
- julee/repositories/minio/tests/test_assembly_specification.py +391 -0
- julee/repositories/minio/tests/test_client_protocol.py +57 -0
- julee/repositories/minio/tests/test_document.py +591 -0
- julee/repositories/minio/tests/test_document_policy_validation.py +192 -0
- julee/repositories/minio/tests/test_knowledge_service_config.py +374 -0
- julee/repositories/minio/tests/test_knowledge_service_query.py +438 -0
- julee/repositories/minio/tests/test_policy.py +559 -0
- julee/repositories/temporal/__init__.py +38 -0
- julee/repositories/temporal/activities.py +114 -0
- julee/repositories/temporal/activity_names.py +34 -0
- julee/repositories/temporal/proxies.py +159 -0
- julee/services/__init__.py +18 -0
- julee/services/knowledge_service/__init__.py +48 -0
- julee/services/knowledge_service/anthropic/__init__.py +12 -0
- julee/services/knowledge_service/anthropic/knowledge_service.py +331 -0
- julee/services/knowledge_service/anthropic/tests/test_knowledge_service.py +318 -0
- julee/services/knowledge_service/factory.py +138 -0
- julee/services/knowledge_service/knowledge_service.py +160 -0
- julee/services/knowledge_service/memory/__init__.py +13 -0
- julee/services/knowledge_service/memory/knowledge_service.py +278 -0
- julee/services/knowledge_service/memory/test_knowledge_service.py +345 -0
- julee/services/knowledge_service/test_factory.py +112 -0
- julee/services/temporal/__init__.py +38 -0
- julee/services/temporal/activities.py +86 -0
- julee/services/temporal/activity_names.py +22 -0
- julee/services/temporal/proxies.py +41 -0
- julee/util/__init__.py +0 -0
- julee/util/domain.py +119 -0
- julee/util/repos/__init__.py +0 -0
- julee/util/repos/minio/__init__.py +0 -0
- julee/util/repos/minio/file_storage.py +213 -0
- julee/util/repos/temporal/__init__.py +11 -0
- julee/util/repos/temporal/client_proxies/file_storage.py +68 -0
- julee/util/repos/temporal/data_converter.py +123 -0
- julee/util/repos/temporal/minio_file_storage.py +12 -0
- julee/util/repos/temporal/proxies/__init__.py +0 -0
- julee/util/repos/temporal/proxies/file_storage.py +58 -0
- julee/util/repositories.py +55 -0
- julee/util/temporal/__init__.py +22 -0
- julee/util/temporal/activities.py +123 -0
- julee/util/temporal/decorators.py +473 -0
- julee/util/tests/__init__.py +1 -0
- julee/util/tests/test_decorators.py +770 -0
- julee/util/validation/__init__.py +29 -0
- julee/util/validation/repository.py +100 -0
- julee/util/validation/type_guards.py +369 -0
- julee/worker.py +211 -0
- julee/workflows/__init__.py +26 -0
- julee/workflows/extract_assemble.py +215 -0
- julee/workflows/validate_document.py +228 -0
- julee-0.1.0.dist-info/METADATA +195 -0
- julee-0.1.0.dist-info/RECORD +161 -0
- julee-0.1.0.dist-info/WHEEL +5 -0
- julee-0.1.0.dist-info/licenses/LICENSE +674 -0
- julee-0.1.0.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Temporal activity wrapper classes for the julee domain.
|
|
3
|
+
|
|
4
|
+
This module contains all @temporal_activity_registration decorated classes
|
|
5
|
+
that wrap pure backend repositories as Temporal activities. These classes are
|
|
6
|
+
imported by the worker to register activities with Temporal.
|
|
7
|
+
|
|
8
|
+
The classes follow the naming pattern documented in systemPatterns.org:
|
|
9
|
+
- Activity names: {domain}.{repo_name}.{method}
|
|
10
|
+
- Each repository type gets its own activity prefix
|
|
11
|
+
"""
|
|
12
|
+
|
|
13
|
+
from julee.util.temporal.decorators import temporal_activity_registration
|
|
14
|
+
from julee.repositories.minio.assembly import MinioAssemblyRepository
|
|
15
|
+
from julee.repositories.minio.assembly_specification import (
|
|
16
|
+
MinioAssemblySpecificationRepository,
|
|
17
|
+
)
|
|
18
|
+
from julee.repositories.minio.document import MinioDocumentRepository
|
|
19
|
+
from julee.repositories.minio.knowledge_service_config import (
|
|
20
|
+
MinioKnowledgeServiceConfigRepository,
|
|
21
|
+
)
|
|
22
|
+
from julee.repositories.minio.knowledge_service_query import (
|
|
23
|
+
MinioKnowledgeServiceQueryRepository,
|
|
24
|
+
)
|
|
25
|
+
from julee.repositories.minio.policy import (
|
|
26
|
+
MinioPolicyRepository,
|
|
27
|
+
)
|
|
28
|
+
from julee.repositories.minio.document_policy_validation import (
|
|
29
|
+
MinioDocumentPolicyValidationRepository,
|
|
30
|
+
)
|
|
31
|
+
|
|
32
|
+
# Import activity name bases from shared module
|
|
33
|
+
from julee.repositories.temporal.activity_names import (
|
|
34
|
+
ASSEMBLY_ACTIVITY_BASE,
|
|
35
|
+
ASSEMBLY_SPECIFICATION_ACTIVITY_BASE,
|
|
36
|
+
DOCUMENT_ACTIVITY_BASE,
|
|
37
|
+
KNOWLEDGE_SERVICE_CONFIG_ACTIVITY_BASE,
|
|
38
|
+
KNOWLEDGE_SERVICE_QUERY_ACTIVITY_BASE,
|
|
39
|
+
POLICY_ACTIVITY_BASE,
|
|
40
|
+
DOCUMENT_POLICY_VALIDATION_ACTIVITY_BASE,
|
|
41
|
+
)
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
@temporal_activity_registration(ASSEMBLY_ACTIVITY_BASE)
|
|
45
|
+
class TemporalMinioAssemblyRepository(MinioAssemblyRepository):
|
|
46
|
+
"""Temporal activity wrapper for MinioAssemblyRepository."""
|
|
47
|
+
|
|
48
|
+
pass
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
@temporal_activity_registration(ASSEMBLY_SPECIFICATION_ACTIVITY_BASE)
|
|
52
|
+
class TemporalMinioAssemblySpecificationRepository(
|
|
53
|
+
MinioAssemblySpecificationRepository
|
|
54
|
+
):
|
|
55
|
+
"""Temporal activity wrapper for MinioAssemblySpecificationRepository."""
|
|
56
|
+
|
|
57
|
+
pass
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
@temporal_activity_registration(DOCUMENT_ACTIVITY_BASE)
|
|
61
|
+
class TemporalMinioDocumentRepository(MinioDocumentRepository):
|
|
62
|
+
"""Temporal activity wrapper for MinioDocumentRepository."""
|
|
63
|
+
|
|
64
|
+
pass
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
@temporal_activity_registration(KNOWLEDGE_SERVICE_CONFIG_ACTIVITY_BASE)
|
|
68
|
+
class TemporalMinioKnowledgeServiceConfigRepository(
|
|
69
|
+
MinioKnowledgeServiceConfigRepository
|
|
70
|
+
):
|
|
71
|
+
"""Temporal activity wrapper for MinioKnowledgeServiceConfigRepository."""
|
|
72
|
+
|
|
73
|
+
pass
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
@temporal_activity_registration(KNOWLEDGE_SERVICE_QUERY_ACTIVITY_BASE)
|
|
77
|
+
class TemporalMinioKnowledgeServiceQueryRepository(
|
|
78
|
+
MinioKnowledgeServiceQueryRepository
|
|
79
|
+
):
|
|
80
|
+
"""Temporal activity wrapper for MinioKnowledgeServiceQueryRepository."""
|
|
81
|
+
|
|
82
|
+
pass
|
|
83
|
+
|
|
84
|
+
|
|
85
|
+
@temporal_activity_registration(POLICY_ACTIVITY_BASE)
|
|
86
|
+
class TemporalMinioPolicyRepository(MinioPolicyRepository):
|
|
87
|
+
"""Temporal activity wrapper for MinioPolicyRepository."""
|
|
88
|
+
|
|
89
|
+
pass
|
|
90
|
+
|
|
91
|
+
|
|
92
|
+
@temporal_activity_registration(DOCUMENT_POLICY_VALIDATION_ACTIVITY_BASE)
|
|
93
|
+
class TemporalMinioDocumentPolicyValidationRepository(
|
|
94
|
+
MinioDocumentPolicyValidationRepository
|
|
95
|
+
):
|
|
96
|
+
"""Temporal activity wrapper for DocumentPolicyValidationRepository."""
|
|
97
|
+
|
|
98
|
+
pass
|
|
99
|
+
|
|
100
|
+
|
|
101
|
+
# Export the temporal repository classes for use in worker.py
|
|
102
|
+
__all__ = [
|
|
103
|
+
"TemporalMinioAssemblyRepository",
|
|
104
|
+
"TemporalMinioAssemblySpecificationRepository",
|
|
105
|
+
"TemporalMinioDocumentRepository",
|
|
106
|
+
"TemporalMinioKnowledgeServiceConfigRepository",
|
|
107
|
+
"TemporalMinioKnowledgeServiceQueryRepository",
|
|
108
|
+
# Export constants for proxy consistency
|
|
109
|
+
"ASSEMBLY_ACTIVITY_BASE",
|
|
110
|
+
"ASSEMBLY_SPECIFICATION_ACTIVITY_BASE",
|
|
111
|
+
"DOCUMENT_ACTIVITY_BASE",
|
|
112
|
+
"KNOWLEDGE_SERVICE_CONFIG_ACTIVITY_BASE",
|
|
113
|
+
"KNOWLEDGE_SERVICE_QUERY_ACTIVITY_BASE",
|
|
114
|
+
]
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Shared activity name constants for the julee domain.
|
|
3
|
+
|
|
4
|
+
This module contains activity name base constants that are shared between
|
|
5
|
+
activities.py and proxies.py, avoiding the need for either module to import
|
|
6
|
+
from the other, which would create problematic transitive dependencies.
|
|
7
|
+
|
|
8
|
+
By isolating these constants in their own module, we maintain DRY principles
|
|
9
|
+
while preserving Temporal's workflow sandbox restrictions. The proxies module
|
|
10
|
+
can import these constants without transitively importing non-deterministic
|
|
11
|
+
backend code from activities.py.
|
|
12
|
+
"""
|
|
13
|
+
|
|
14
|
+
# Activity name bases - shared constants for consistency between
|
|
15
|
+
# activity registrations and workflow proxies
|
|
16
|
+
ASSEMBLY_ACTIVITY_BASE = "julee.assembly_repo.minio"
|
|
17
|
+
ASSEMBLY_SPECIFICATION_ACTIVITY_BASE = "julee.assembly_specification_repo.minio"
|
|
18
|
+
DOCUMENT_ACTIVITY_BASE = "julee.document_repo.minio"
|
|
19
|
+
KNOWLEDGE_SERVICE_CONFIG_ACTIVITY_BASE = "julee.knowledge_service_config_repo.minio"
|
|
20
|
+
KNOWLEDGE_SERVICE_QUERY_ACTIVITY_BASE = "julee.knowledge_service_query_repo.minio"
|
|
21
|
+
POLICY_ACTIVITY_BASE = "julee.policy_repo.minio"
|
|
22
|
+
DOCUMENT_POLICY_VALIDATION_ACTIVITY_BASE = "julee.document_policy_validation_repo.minio"
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
# Export all constants
|
|
26
|
+
__all__ = [
|
|
27
|
+
"ASSEMBLY_ACTIVITY_BASE",
|
|
28
|
+
"ASSEMBLY_SPECIFICATION_ACTIVITY_BASE",
|
|
29
|
+
"DOCUMENT_ACTIVITY_BASE",
|
|
30
|
+
"KNOWLEDGE_SERVICE_CONFIG_ACTIVITY_BASE",
|
|
31
|
+
"KNOWLEDGE_SERVICE_QUERY_ACTIVITY_BASE",
|
|
32
|
+
"POLICY_ACTIVITY_BASE",
|
|
33
|
+
"DOCUMENT_POLICY_VALIDATION_ACTIVITY_BASE",
|
|
34
|
+
]
|
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Workflow-safe proxy classes for the julee domain.
|
|
3
|
+
|
|
4
|
+
This module contains all @temporal_workflow_proxy decorated classes that
|
|
5
|
+
delegate to Temporal activities from within workflows. These classes are
|
|
6
|
+
isolated from backend imports to avoid Temporal's workflow sandbox
|
|
7
|
+
restrictions.
|
|
8
|
+
|
|
9
|
+
The proxy classes automatically generate methods that call
|
|
10
|
+
workflow.execute_activity() with the appropriate activity names, timeouts,
|
|
11
|
+
and retry policies.
|
|
12
|
+
"""
|
|
13
|
+
|
|
14
|
+
from julee.util.temporal.decorators import temporal_workflow_proxy
|
|
15
|
+
from julee.domain.repositories.assembly import AssemblyRepository
|
|
16
|
+
from julee.domain.repositories.assembly_specification import (
|
|
17
|
+
AssemblySpecificationRepository,
|
|
18
|
+
)
|
|
19
|
+
from julee.domain.repositories.document import DocumentRepository
|
|
20
|
+
from julee.domain.repositories.knowledge_service_config import (
|
|
21
|
+
KnowledgeServiceConfigRepository,
|
|
22
|
+
)
|
|
23
|
+
from julee.domain.repositories.knowledge_service_query import (
|
|
24
|
+
KnowledgeServiceQueryRepository,
|
|
25
|
+
)
|
|
26
|
+
from julee.domain.repositories.policy import PolicyRepository
|
|
27
|
+
from julee.domain.repositories.document_policy_validation import (
|
|
28
|
+
DocumentPolicyValidationRepository,
|
|
29
|
+
)
|
|
30
|
+
|
|
31
|
+
# Import activity name bases from shared module
|
|
32
|
+
from julee.repositories.temporal.activity_names import (
|
|
33
|
+
ASSEMBLY_ACTIVITY_BASE,
|
|
34
|
+
ASSEMBLY_SPECIFICATION_ACTIVITY_BASE,
|
|
35
|
+
DOCUMENT_ACTIVITY_BASE,
|
|
36
|
+
KNOWLEDGE_SERVICE_CONFIG_ACTIVITY_BASE,
|
|
37
|
+
KNOWLEDGE_SERVICE_QUERY_ACTIVITY_BASE,
|
|
38
|
+
POLICY_ACTIVITY_BASE,
|
|
39
|
+
DOCUMENT_POLICY_VALIDATION_ACTIVITY_BASE,
|
|
40
|
+
)
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
@temporal_workflow_proxy(
|
|
44
|
+
activity_base=ASSEMBLY_ACTIVITY_BASE,
|
|
45
|
+
default_timeout_seconds=30,
|
|
46
|
+
retry_methods=["save", "generate_id"],
|
|
47
|
+
)
|
|
48
|
+
class WorkflowAssemblyRepositoryProxy(AssemblyRepository):
|
|
49
|
+
"""
|
|
50
|
+
Workflow implementation of AssemblyRepository that calls activities.
|
|
51
|
+
All methods are automatically generated by the @temporal_workflow_proxy
|
|
52
|
+
decorator.
|
|
53
|
+
"""
|
|
54
|
+
|
|
55
|
+
pass
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
@temporal_workflow_proxy(
|
|
59
|
+
activity_base=ASSEMBLY_SPECIFICATION_ACTIVITY_BASE,
|
|
60
|
+
default_timeout_seconds=30,
|
|
61
|
+
retry_methods=["save", "generate_id"],
|
|
62
|
+
)
|
|
63
|
+
class WorkflowAssemblySpecificationRepositoryProxy(AssemblySpecificationRepository):
|
|
64
|
+
"""
|
|
65
|
+
Workflow implementation of AssemblySpecificationRepository that calls
|
|
66
|
+
activities.
|
|
67
|
+
All methods are automatically generated by the @temporal_workflow_proxy
|
|
68
|
+
decorator.
|
|
69
|
+
"""
|
|
70
|
+
|
|
71
|
+
pass
|
|
72
|
+
|
|
73
|
+
|
|
74
|
+
@temporal_workflow_proxy(
|
|
75
|
+
activity_base=DOCUMENT_ACTIVITY_BASE,
|
|
76
|
+
default_timeout_seconds=30,
|
|
77
|
+
retry_methods=["save", "generate_id"],
|
|
78
|
+
)
|
|
79
|
+
class WorkflowDocumentRepositoryProxy(DocumentRepository):
|
|
80
|
+
"""
|
|
81
|
+
Workflow implementation of DocumentRepository that calls activities.
|
|
82
|
+
All methods are automatically generated by the @temporal_workflow_proxy
|
|
83
|
+
decorator.
|
|
84
|
+
"""
|
|
85
|
+
|
|
86
|
+
pass
|
|
87
|
+
|
|
88
|
+
|
|
89
|
+
@temporal_workflow_proxy(
|
|
90
|
+
activity_base=KNOWLEDGE_SERVICE_CONFIG_ACTIVITY_BASE,
|
|
91
|
+
default_timeout_seconds=30,
|
|
92
|
+
retry_methods=["save", "generate_id"],
|
|
93
|
+
)
|
|
94
|
+
class WorkflowKnowledgeServiceConfigRepositoryProxy(KnowledgeServiceConfigRepository):
|
|
95
|
+
"""
|
|
96
|
+
Workflow implementation of KnowledgeServiceConfigRepository that calls
|
|
97
|
+
activities.
|
|
98
|
+
All methods are automatically generated by the @temporal_workflow_proxy
|
|
99
|
+
decorator.
|
|
100
|
+
"""
|
|
101
|
+
|
|
102
|
+
pass
|
|
103
|
+
|
|
104
|
+
|
|
105
|
+
@temporal_workflow_proxy(
|
|
106
|
+
activity_base=KNOWLEDGE_SERVICE_QUERY_ACTIVITY_BASE,
|
|
107
|
+
default_timeout_seconds=30,
|
|
108
|
+
retry_methods=["save", "generate_id"],
|
|
109
|
+
)
|
|
110
|
+
class WorkflowKnowledgeServiceQueryRepositoryProxy(KnowledgeServiceQueryRepository):
|
|
111
|
+
"""
|
|
112
|
+
Workflow implementation of KnowledgeServiceQueryRepository that calls
|
|
113
|
+
activities. All methods are automatically generated by the
|
|
114
|
+
@temporal_workflow_proxy decorator.
|
|
115
|
+
"""
|
|
116
|
+
|
|
117
|
+
pass
|
|
118
|
+
|
|
119
|
+
|
|
120
|
+
@temporal_workflow_proxy(
|
|
121
|
+
activity_base=POLICY_ACTIVITY_BASE,
|
|
122
|
+
default_timeout_seconds=30,
|
|
123
|
+
retry_methods=["save", "generate_id"],
|
|
124
|
+
)
|
|
125
|
+
class WorkflowPolicyRepositoryProxy(PolicyRepository):
|
|
126
|
+
"""
|
|
127
|
+
Workflow implementation of PolicyRepository that calls activities.
|
|
128
|
+
All methods are automatically generated by the @temporal_workflow_proxy
|
|
129
|
+
decorator.
|
|
130
|
+
"""
|
|
131
|
+
|
|
132
|
+
pass
|
|
133
|
+
|
|
134
|
+
|
|
135
|
+
@temporal_workflow_proxy(
|
|
136
|
+
activity_base=DOCUMENT_POLICY_VALIDATION_ACTIVITY_BASE,
|
|
137
|
+
default_timeout_seconds=30,
|
|
138
|
+
retry_methods=["save", "generate_id"],
|
|
139
|
+
)
|
|
140
|
+
class WorkflowDocumentPolicyValidationRepositoryProxy(
|
|
141
|
+
DocumentPolicyValidationRepository
|
|
142
|
+
):
|
|
143
|
+
"""
|
|
144
|
+
Workflow implementation of DocumentPolicyValidationRepository that calls
|
|
145
|
+
activities. All methods are automatically generated by the
|
|
146
|
+
@temporal_workflow_proxy decorator.
|
|
147
|
+
"""
|
|
148
|
+
|
|
149
|
+
pass
|
|
150
|
+
|
|
151
|
+
|
|
152
|
+
# Export the workflow proxy classes
|
|
153
|
+
__all__ = [
|
|
154
|
+
"WorkflowAssemblyRepositoryProxy",
|
|
155
|
+
"WorkflowAssemblySpecificationRepositoryProxy",
|
|
156
|
+
"WorkflowDocumentRepositoryProxy",
|
|
157
|
+
"WorkflowKnowledgeServiceConfigRepositoryProxy",
|
|
158
|
+
"WorkflowKnowledgeServiceQueryRepositoryProxy",
|
|
159
|
+
]
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Services for julee domain.
|
|
3
|
+
|
|
4
|
+
This module provides service classes and factory functions for interacting
|
|
5
|
+
with external services in the Capture, Extract, Assemble, Publish workflow.
|
|
6
|
+
|
|
7
|
+
The services layer handles external integrations while the repository layer
|
|
8
|
+
handles local metadata persistence. Services are organized by service type
|
|
9
|
+
into submodules, each with their own protocols and implementations.
|
|
10
|
+
"""
|
|
11
|
+
|
|
12
|
+
# Re-export knowledge service components
|
|
13
|
+
from .knowledge_service import KnowledgeService
|
|
14
|
+
|
|
15
|
+
__all__ = [
|
|
16
|
+
# Knowledge Service
|
|
17
|
+
"KnowledgeService",
|
|
18
|
+
]
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Knowledge Service module for julee domain.
|
|
3
|
+
|
|
4
|
+
This module provides the KnowledgeService protocol and factory function for
|
|
5
|
+
creating configured knowledge service instances. The factory routes to the
|
|
6
|
+
appropriate implementation based on the service_api configuration.
|
|
7
|
+
"""
|
|
8
|
+
|
|
9
|
+
import logging
|
|
10
|
+
|
|
11
|
+
from .knowledge_service import (
|
|
12
|
+
KnowledgeService,
|
|
13
|
+
QueryResult,
|
|
14
|
+
FileRegistrationResult,
|
|
15
|
+
)
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
logger = logging.getLogger(__name__)
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
def ensure_knowledge_service(service: object) -> KnowledgeService:
|
|
22
|
+
"""Ensure an object satisfies the KnowledgeService protocol.
|
|
23
|
+
|
|
24
|
+
Args:
|
|
25
|
+
service: The service implementation to validate
|
|
26
|
+
|
|
27
|
+
Returns:
|
|
28
|
+
The validated service (type checker knows it satisfies
|
|
29
|
+
KnowledgeService)
|
|
30
|
+
|
|
31
|
+
Raises:
|
|
32
|
+
TypeError: If the service doesn't satisfy the protocol
|
|
33
|
+
"""
|
|
34
|
+
if not isinstance(service, KnowledgeService):
|
|
35
|
+
raise TypeError(
|
|
36
|
+
f"Service {type(service).__name__} does not satisfy "
|
|
37
|
+
f"KnowledgeService protocol"
|
|
38
|
+
)
|
|
39
|
+
|
|
40
|
+
return service
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
__all__ = [
|
|
44
|
+
"KnowledgeService",
|
|
45
|
+
"ensure_knowledge_service",
|
|
46
|
+
"QueryResult",
|
|
47
|
+
"FileRegistrationResult",
|
|
48
|
+
]
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Anthropic service implementations for julee domain.
|
|
3
|
+
|
|
4
|
+
This module exports Anthropic-specific implementations of service protocols
|
|
5
|
+
for the Capture, Extract, Assemble, Publish workflow.
|
|
6
|
+
"""
|
|
7
|
+
|
|
8
|
+
from .knowledge_service import AnthropicKnowledgeService
|
|
9
|
+
|
|
10
|
+
__all__ = [
|
|
11
|
+
"AnthropicKnowledgeService",
|
|
12
|
+
]
|