julee 0.1.1__py3-none-any.whl → 0.1.3__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/api/app.py +9 -8
- julee/api/dependencies.py +15 -15
- julee/api/requests.py +10 -9
- julee/api/responses.py +2 -1
- julee/api/routers/__init__.py +5 -5
- julee/api/routers/assembly_specifications.py +5 -4
- julee/api/routers/documents.py +1 -1
- julee/api/routers/knowledge_service_configs.py +4 -3
- julee/api/routers/knowledge_service_queries.py +7 -6
- julee/api/routers/system.py +4 -3
- julee/api/routers/workflows.py +4 -5
- julee/api/services/system_initialization.py +6 -6
- julee/api/tests/routers/test_assembly_specifications.py +4 -3
- julee/api/tests/routers/test_documents.py +5 -4
- julee/api/tests/routers/test_knowledge_service_configs.py +7 -6
- julee/api/tests/routers/test_knowledge_service_queries.py +4 -3
- julee/api/tests/routers/test_system.py +5 -4
- julee/api/tests/routers/test_workflows.py +5 -4
- julee/api/tests/test_app.py +5 -4
- julee/api/tests/test_dependencies.py +3 -2
- julee/api/tests/test_requests.py +2 -1
- julee/contrib/__init__.py +15 -0
- julee/contrib/polling/__init__.py +47 -0
- julee/contrib/polling/domain/__init__.py +17 -0
- julee/contrib/polling/domain/models/__init__.py +13 -0
- julee/contrib/polling/domain/models/polling_config.py +39 -0
- julee/contrib/polling/domain/services/__init__.py +11 -0
- julee/contrib/polling/domain/services/poller.py +39 -0
- julee/contrib/polling/infrastructure/__init__.py +15 -0
- julee/contrib/polling/infrastructure/services/__init__.py +12 -0
- julee/contrib/polling/infrastructure/services/polling/__init__.py +12 -0
- julee/contrib/polling/infrastructure/services/polling/http/__init__.py +12 -0
- julee/contrib/polling/infrastructure/services/polling/http/http_poller_service.py +80 -0
- julee/contrib/polling/infrastructure/temporal/__init__.py +20 -0
- julee/contrib/polling/infrastructure/temporal/activities.py +42 -0
- julee/contrib/polling/infrastructure/temporal/activity_names.py +20 -0
- julee/contrib/polling/infrastructure/temporal/proxies.py +45 -0
- julee/contrib/polling/tests/__init__.py +6 -0
- julee/contrib/polling/tests/unit/__init__.py +6 -0
- julee/contrib/polling/tests/unit/infrastructure/__init__.py +7 -0
- julee/contrib/polling/tests/unit/infrastructure/services/__init__.py +6 -0
- julee/contrib/polling/tests/unit/infrastructure/services/polling/__init__.py +6 -0
- julee/contrib/polling/tests/unit/infrastructure/services/polling/http/__init__.py +7 -0
- julee/contrib/polling/tests/unit/infrastructure/services/polling/http/test_http_poller_service.py +163 -0
- julee/docs/__init__.py +5 -0
- julee/docs/sphinx_hcd/__init__.py +82 -0
- julee/docs/sphinx_hcd/accelerators.py +1078 -0
- julee/docs/sphinx_hcd/apps.py +499 -0
- julee/docs/sphinx_hcd/config.py +148 -0
- julee/docs/sphinx_hcd/epics.py +448 -0
- julee/docs/sphinx_hcd/integrations.py +306 -0
- julee/docs/sphinx_hcd/journeys.py +783 -0
- julee/docs/sphinx_hcd/personas.py +435 -0
- julee/docs/sphinx_hcd/stories.py +932 -0
- julee/docs/sphinx_hcd/utils.py +180 -0
- julee/domain/models/__init__.py +5 -6
- julee/domain/models/assembly/assembly.py +7 -7
- julee/domain/models/assembly/tests/factories.py +2 -1
- julee/domain/models/assembly/tests/test_assembly.py +16 -13
- julee/domain/models/assembly_specification/assembly_specification.py +11 -10
- julee/domain/models/assembly_specification/knowledge_service_query.py +14 -9
- julee/domain/models/assembly_specification/tests/factories.py +2 -1
- julee/domain/models/assembly_specification/tests/test_assembly_specification.py +9 -6
- julee/domain/models/assembly_specification/tests/test_knowledge_service_query.py +3 -1
- julee/domain/models/custom_fields/content_stream.py +3 -2
- julee/domain/models/custom_fields/tests/test_custom_fields.py +2 -1
- julee/domain/models/document/document.py +12 -10
- julee/domain/models/document/tests/factories.py +3 -2
- julee/domain/models/document/tests/test_document.py +6 -3
- julee/domain/models/knowledge_service_config/knowledge_service_config.py +4 -4
- julee/domain/models/policy/__init__.py +4 -4
- julee/domain/models/policy/document_policy_validation.py +17 -17
- julee/domain/models/policy/policy.py +12 -10
- julee/domain/models/policy/tests/factories.py +2 -1
- julee/domain/models/policy/tests/test_document_policy_validation.py +3 -1
- julee/domain/models/policy/tests/test_policy.py +2 -1
- julee/domain/repositories/__init__.py +3 -3
- julee/domain/repositories/assembly.py +3 -1
- julee/domain/repositories/assembly_specification.py +2 -0
- julee/domain/repositories/base.py +33 -16
- julee/domain/repositories/document.py +3 -1
- julee/domain/repositories/document_policy_validation.py +3 -1
- julee/domain/repositories/knowledge_service_config.py +2 -0
- julee/domain/repositories/knowledge_service_query.py +1 -0
- julee/domain/repositories/policy.py +3 -1
- julee/domain/use_cases/decorators.py +3 -2
- julee/domain/use_cases/extract_assemble_data.py +23 -13
- julee/domain/use_cases/initialize_system_data.py +13 -13
- julee/domain/use_cases/tests/test_extract_assemble_data.py +10 -10
- julee/domain/use_cases/tests/test_initialize_system_data.py +2 -2
- julee/domain/use_cases/tests/test_validate_document.py +11 -11
- julee/domain/use_cases/validate_document.py +26 -15
- julee/maintenance/__init__.py +1 -0
- julee/maintenance/release.py +188 -0
- julee/repositories/__init__.py +4 -1
- julee/repositories/memory/assembly.py +6 -5
- julee/repositories/memory/assembly_specification.py +9 -9
- julee/repositories/memory/base.py +12 -11
- julee/repositories/memory/document.py +8 -7
- julee/repositories/memory/document_policy_validation.py +7 -6
- julee/repositories/memory/knowledge_service_config.py +9 -7
- julee/repositories/memory/knowledge_service_query.py +9 -7
- julee/repositories/memory/policy.py +6 -5
- julee/repositories/memory/tests/test_document.py +6 -4
- julee/repositories/memory/tests/test_document_policy_validation.py +2 -1
- julee/repositories/memory/tests/test_policy.py +2 -1
- julee/repositories/minio/assembly.py +4 -4
- julee/repositories/minio/assembly_specification.py +6 -8
- julee/repositories/minio/client.py +22 -25
- julee/repositories/minio/document.py +11 -11
- julee/repositories/minio/document_policy_validation.py +5 -5
- julee/repositories/minio/knowledge_service_config.py +8 -8
- julee/repositories/minio/knowledge_service_query.py +6 -9
- julee/repositories/minio/policy.py +4 -4
- julee/repositories/minio/tests/fake_client.py +11 -9
- julee/repositories/minio/tests/test_assembly.py +3 -1
- julee/repositories/minio/tests/test_assembly_specification.py +2 -1
- julee/repositories/minio/tests/test_client_protocol.py +5 -5
- julee/repositories/minio/tests/test_document.py +7 -6
- julee/repositories/minio/tests/test_document_policy_validation.py +3 -1
- julee/repositories/minio/tests/test_knowledge_service_config.py +4 -2
- julee/repositories/minio/tests/test_knowledge_service_query.py +3 -2
- julee/repositories/minio/tests/test_policy.py +3 -1
- julee/repositories/temporal/activities.py +5 -5
- julee/repositories/temporal/proxies.py +5 -5
- julee/services/knowledge_service/__init__.py +1 -2
- julee/services/knowledge_service/anthropic/knowledge_service.py +8 -7
- julee/services/knowledge_service/anthropic/tests/test_knowledge_service.py +11 -10
- julee/services/knowledge_service/factory.py +8 -8
- julee/services/knowledge_service/knowledge_service.py +22 -18
- julee/services/knowledge_service/memory/knowledge_service.py +13 -12
- julee/services/knowledge_service/memory/test_knowledge_service.py +10 -7
- julee/services/knowledge_service/test_factory.py +11 -10
- julee/services/temporal/activities.py +10 -10
- julee/services/temporal/proxies.py +2 -2
- julee/util/domain.py +6 -6
- julee/util/repos/minio/file_storage.py +8 -9
- julee/util/repos/temporal/client_proxies/file_storage.py +3 -4
- julee/util/repos/temporal/data_converter.py +6 -6
- julee/util/repos/temporal/minio_file_storage.py +1 -1
- julee/util/repos/temporal/proxies/file_storage.py +2 -3
- julee/util/repositories.py +6 -7
- julee/util/temporal/activities.py +1 -1
- julee/util/temporal/decorators.py +28 -33
- julee/util/tests/test_decorators.py +13 -15
- julee/util/validation/repository.py +3 -3
- julee/util/validation/type_guards.py +12 -11
- julee/worker.py +9 -8
- julee/workflows/__init__.py +2 -2
- julee/workflows/extract_assemble.py +2 -1
- julee/workflows/validate_document.py +3 -2
- {julee-0.1.1.dist-info → julee-0.1.3.dist-info}/METADATA +4 -1
- julee-0.1.3.dist-info/RECORD +197 -0
- julee-0.1.1.dist-info/RECORD +0 -161
- {julee-0.1.1.dist-info → julee-0.1.3.dist-info}/WHEEL +0 -0
- {julee-0.1.1.dist-info → julee-0.1.3.dist-info}/licenses/LICENSE +0 -0
- {julee-0.1.1.dist-info → julee-0.1.3.dist-info}/top_level.txt +0 -0
julee/api/app.py
CHANGED
|
@@ -15,27 +15,28 @@ with proper HTTP status codes and error handling.
|
|
|
15
15
|
"""
|
|
16
16
|
|
|
17
17
|
import logging
|
|
18
|
-
import
|
|
18
|
+
from collections.abc import AsyncGenerator, Callable
|
|
19
19
|
from contextlib import asynccontextmanager
|
|
20
|
-
from typing import
|
|
20
|
+
from typing import Any
|
|
21
21
|
|
|
22
|
+
import uvicorn
|
|
22
23
|
from fastapi import FastAPI
|
|
23
24
|
from fastapi.middleware.cors import CORSMiddleware
|
|
24
25
|
from fastapi_pagination import add_pagination
|
|
25
26
|
from fastapi_pagination.utils import disable_installed_extensions_check
|
|
26
27
|
|
|
28
|
+
from julee.api.dependencies import (
|
|
29
|
+
get_knowledge_service_config_repository,
|
|
30
|
+
get_startup_dependencies,
|
|
31
|
+
)
|
|
27
32
|
from julee.api.routers import (
|
|
28
33
|
assembly_specifications_router,
|
|
29
|
-
|
|
34
|
+
documents_router,
|
|
30
35
|
knowledge_service_configs_router,
|
|
36
|
+
knowledge_service_queries_router,
|
|
31
37
|
system_router,
|
|
32
|
-
documents_router,
|
|
33
38
|
workflows_router,
|
|
34
39
|
)
|
|
35
|
-
from julee.api.dependencies import (
|
|
36
|
-
get_startup_dependencies,
|
|
37
|
-
get_knowledge_service_config_repository,
|
|
38
|
-
)
|
|
39
40
|
|
|
40
41
|
# Disable pagination extensions check for cleaner startup
|
|
41
42
|
disable_installed_extensions_check()
|
julee/api/dependencies.py
CHANGED
|
@@ -10,9 +10,9 @@ The dependencies focus on real Minio implementations for production use,
|
|
|
10
10
|
with test overrides available through FastAPI's dependency override system.
|
|
11
11
|
"""
|
|
12
12
|
|
|
13
|
-
import os
|
|
14
13
|
import logging
|
|
15
|
-
|
|
14
|
+
import os
|
|
15
|
+
from typing import TYPE_CHECKING, Any
|
|
16
16
|
|
|
17
17
|
if TYPE_CHECKING:
|
|
18
18
|
from julee.api.services.system_initialization import (
|
|
@@ -20,35 +20,35 @@ if TYPE_CHECKING:
|
|
|
20
20
|
)
|
|
21
21
|
|
|
22
22
|
from fastapi import Depends
|
|
23
|
+
from minio import Minio
|
|
23
24
|
from temporalio.client import Client
|
|
24
25
|
from temporalio.contrib.pydantic import pydantic_data_converter
|
|
25
26
|
|
|
26
|
-
from julee.domain.repositories.knowledge_service_query import (
|
|
27
|
-
KnowledgeServiceQueryRepository,
|
|
28
|
-
)
|
|
29
|
-
from julee.domain.repositories.knowledge_service_config import (
|
|
30
|
-
KnowledgeServiceConfigRepository,
|
|
31
|
-
)
|
|
32
27
|
from julee.domain.repositories.assembly_specification import (
|
|
33
28
|
AssemblySpecificationRepository,
|
|
34
29
|
)
|
|
35
30
|
from julee.domain.repositories.document import (
|
|
36
31
|
DocumentRepository,
|
|
37
32
|
)
|
|
38
|
-
from julee.repositories.
|
|
39
|
-
|
|
33
|
+
from julee.domain.repositories.knowledge_service_config import (
|
|
34
|
+
KnowledgeServiceConfigRepository,
|
|
40
35
|
)
|
|
41
|
-
from julee.repositories.
|
|
42
|
-
|
|
36
|
+
from julee.domain.repositories.knowledge_service_query import (
|
|
37
|
+
KnowledgeServiceQueryRepository,
|
|
43
38
|
)
|
|
44
39
|
from julee.repositories.minio.assembly_specification import (
|
|
45
40
|
MinioAssemblySpecificationRepository,
|
|
46
41
|
)
|
|
42
|
+
from julee.repositories.minio.client import MinioClient
|
|
47
43
|
from julee.repositories.minio.document import (
|
|
48
44
|
MinioDocumentRepository,
|
|
49
45
|
)
|
|
50
|
-
from julee.repositories.minio.
|
|
51
|
-
|
|
46
|
+
from julee.repositories.minio.knowledge_service_config import (
|
|
47
|
+
MinioKnowledgeServiceConfigRepository,
|
|
48
|
+
)
|
|
49
|
+
from julee.repositories.minio.knowledge_service_query import (
|
|
50
|
+
MinioKnowledgeServiceQueryRepository,
|
|
51
|
+
)
|
|
52
52
|
|
|
53
53
|
logger = logging.getLogger(__name__)
|
|
54
54
|
|
|
@@ -60,7 +60,7 @@ class DependencyContainer:
|
|
|
60
60
|
"""
|
|
61
61
|
|
|
62
62
|
def __init__(self) -> None:
|
|
63
|
-
self._instances:
|
|
63
|
+
self._instances: dict[str, Any] = {}
|
|
64
64
|
|
|
65
65
|
async def get_or_create(self, key: str, factory: Any) -> Any:
|
|
66
66
|
"""Get or create a singleton instance."""
|
julee/api/requests.py
CHANGED
|
@@ -7,9 +7,10 @@ to domain model class methods and reuse field descriptions to avoid
|
|
|
7
7
|
duplication while maintaining single source of truth in the domain layer.
|
|
8
8
|
"""
|
|
9
9
|
|
|
10
|
-
from typing import Dict, Any, Optional
|
|
11
|
-
from pydantic import BaseModel, Field, field_validator, ValidationInfo
|
|
12
10
|
from datetime import datetime, timezone
|
|
11
|
+
from typing import Any
|
|
12
|
+
|
|
13
|
+
from pydantic import BaseModel, Field, ValidationInfo, field_validator
|
|
13
14
|
|
|
14
15
|
from julee.domain.models import (
|
|
15
16
|
AssemblySpecification,
|
|
@@ -38,10 +39,10 @@ class CreateAssemblySpecificationRequest(BaseModel):
|
|
|
38
39
|
applicability: str = Field(
|
|
39
40
|
description=AssemblySpecification.model_fields["applicability"].description
|
|
40
41
|
)
|
|
41
|
-
jsonschema:
|
|
42
|
+
jsonschema: dict[str, Any] = Field(
|
|
42
43
|
description=AssemblySpecification.model_fields["jsonschema"].description
|
|
43
44
|
)
|
|
44
|
-
knowledge_service_queries:
|
|
45
|
+
knowledge_service_queries: dict[str, str] = Field(
|
|
45
46
|
default_factory=dict,
|
|
46
47
|
description=AssemblySpecification.model_fields[
|
|
47
48
|
"knowledge_service_queries"
|
|
@@ -65,14 +66,14 @@ class CreateAssemblySpecificationRequest(BaseModel):
|
|
|
65
66
|
|
|
66
67
|
@field_validator("jsonschema")
|
|
67
68
|
@classmethod
|
|
68
|
-
def validate_jsonschema(cls, v:
|
|
69
|
+
def validate_jsonschema(cls, v: dict[str, Any]) -> dict[str, Any]:
|
|
69
70
|
return AssemblySpecification.jsonschema_must_be_valid(v)
|
|
70
71
|
|
|
71
72
|
@field_validator("knowledge_service_queries")
|
|
72
73
|
@classmethod
|
|
73
74
|
def validate_knowledge_service_queries(
|
|
74
|
-
cls, v:
|
|
75
|
-
) ->
|
|
75
|
+
cls, v: dict[str, str], info: ValidationInfo
|
|
76
|
+
) -> dict[str, str]:
|
|
76
77
|
return AssemblySpecification.knowledge_service_queries_must_be_valid(v, info)
|
|
77
78
|
|
|
78
79
|
@field_validator("version")
|
|
@@ -128,11 +129,11 @@ class CreateKnowledgeServiceQueryRequest(BaseModel):
|
|
|
128
129
|
prompt: str = Field(
|
|
129
130
|
description=KnowledgeServiceQuery.model_fields["prompt"].description
|
|
130
131
|
)
|
|
131
|
-
query_metadata:
|
|
132
|
+
query_metadata: dict[str, Any] = Field(
|
|
132
133
|
default_factory=dict,
|
|
133
134
|
description=KnowledgeServiceQuery.model_fields["query_metadata"].description,
|
|
134
135
|
)
|
|
135
|
-
assistant_prompt:
|
|
136
|
+
assistant_prompt: str | None = Field(
|
|
136
137
|
default=KnowledgeServiceQuery.model_fields["assistant_prompt"].default,
|
|
137
138
|
description=KnowledgeServiceQuery.model_fields["assistant_prompt"].description,
|
|
138
139
|
)
|
julee/api/responses.py
CHANGED
|
@@ -8,9 +8,10 @@ only response models that are specific to API concerns and not represented
|
|
|
8
8
|
by existing domain models.
|
|
9
9
|
"""
|
|
10
10
|
|
|
11
|
-
from pydantic import BaseModel
|
|
12
11
|
from enum import Enum
|
|
13
12
|
|
|
13
|
+
from pydantic import BaseModel
|
|
14
|
+
|
|
14
15
|
|
|
15
16
|
class ServiceStatus(str, Enum):
|
|
16
17
|
"""Service status enumeration."""
|
julee/api/routers/__init__.py
CHANGED
|
@@ -20,17 +20,17 @@ Router modules follow the pattern:
|
|
|
20
20
|
"""
|
|
21
21
|
|
|
22
22
|
# Import routers for convenient access
|
|
23
|
-
from julee.api.routers.
|
|
24
|
-
router as
|
|
23
|
+
from julee.api.routers.assembly_specifications import (
|
|
24
|
+
router as assembly_specifications_router,
|
|
25
25
|
)
|
|
26
|
+
from julee.api.routers.documents import router as documents_router
|
|
26
27
|
from julee.api.routers.knowledge_service_configs import (
|
|
27
28
|
router as knowledge_service_configs_router,
|
|
28
29
|
)
|
|
29
|
-
from julee.api.routers.
|
|
30
|
-
router as
|
|
30
|
+
from julee.api.routers.knowledge_service_queries import (
|
|
31
|
+
router as knowledge_service_queries_router,
|
|
31
32
|
)
|
|
32
33
|
from julee.api.routers.system import router as system_router
|
|
33
|
-
from julee.api.routers.documents import router as documents_router
|
|
34
34
|
from julee.api.routers.workflows import router as workflows_router
|
|
35
35
|
|
|
36
36
|
__all__ = [
|
|
@@ -14,17 +14,18 @@ These routes are mounted at /assembly_specifications in the main app.
|
|
|
14
14
|
|
|
15
15
|
import logging
|
|
16
16
|
from typing import cast
|
|
17
|
+
|
|
17
18
|
from fastapi import APIRouter, Depends, HTTPException, Path
|
|
18
19
|
from fastapi_pagination import Page, paginate
|
|
19
20
|
|
|
20
|
-
from julee.domain.models import AssemblySpecification
|
|
21
|
-
from julee.domain.repositories.assembly_specification import (
|
|
22
|
-
AssemblySpecificationRepository,
|
|
23
|
-
)
|
|
24
21
|
from julee.api.dependencies import (
|
|
25
22
|
get_assembly_specification_repository,
|
|
26
23
|
)
|
|
27
24
|
from julee.api.requests import CreateAssemblySpecificationRequest
|
|
25
|
+
from julee.domain.models import AssemblySpecification
|
|
26
|
+
from julee.domain.repositories.assembly_specification import (
|
|
27
|
+
AssemblySpecificationRepository,
|
|
28
|
+
)
|
|
28
29
|
|
|
29
30
|
logger = logging.getLogger(__name__)
|
|
30
31
|
|
julee/api/routers/documents.py
CHANGED
|
@@ -19,9 +19,9 @@ from fastapi import APIRouter, Depends, HTTPException, Path
|
|
|
19
19
|
from fastapi.responses import Response
|
|
20
20
|
from fastapi_pagination import Page, paginate
|
|
21
21
|
|
|
22
|
+
from julee.api.dependencies import get_document_repository
|
|
22
23
|
from julee.domain.models.document import Document
|
|
23
24
|
from julee.domain.repositories.document import DocumentRepository
|
|
24
|
-
from julee.api.dependencies import get_document_repository
|
|
25
25
|
|
|
26
26
|
logger = logging.getLogger(__name__)
|
|
27
27
|
|
|
@@ -13,18 +13,19 @@ These routes are mounted at /knowledge_service_configs in the main app.
|
|
|
13
13
|
|
|
14
14
|
import logging
|
|
15
15
|
from typing import cast
|
|
16
|
+
|
|
16
17
|
from fastapi import APIRouter, Depends, HTTPException
|
|
17
18
|
from fastapi_pagination import Page, paginate
|
|
18
19
|
|
|
20
|
+
from julee.api.dependencies import (
|
|
21
|
+
get_knowledge_service_config_repository,
|
|
22
|
+
)
|
|
19
23
|
from julee.domain.models.knowledge_service_config import (
|
|
20
24
|
KnowledgeServiceConfig,
|
|
21
25
|
)
|
|
22
26
|
from julee.domain.repositories.knowledge_service_config import (
|
|
23
27
|
KnowledgeServiceConfigRepository,
|
|
24
28
|
)
|
|
25
|
-
from julee.api.dependencies import (
|
|
26
|
-
get_knowledge_service_config_repository,
|
|
27
|
-
)
|
|
28
29
|
|
|
29
30
|
logger = logging.getLogger(__name__)
|
|
30
31
|
|
|
@@ -14,18 +14,19 @@ These routes are mounted at /knowledge_service_queries in the main app.
|
|
|
14
14
|
"""
|
|
15
15
|
|
|
16
16
|
import logging
|
|
17
|
-
from typing import
|
|
17
|
+
from typing import cast
|
|
18
|
+
|
|
18
19
|
from fastapi import APIRouter, Depends, HTTPException, Query
|
|
19
20
|
from fastapi_pagination import Page, paginate
|
|
20
21
|
|
|
21
|
-
from julee.domain.models import KnowledgeServiceQuery
|
|
22
|
-
from julee.domain.repositories.knowledge_service_query import (
|
|
23
|
-
KnowledgeServiceQueryRepository,
|
|
24
|
-
)
|
|
25
22
|
from julee.api.dependencies import (
|
|
26
23
|
get_knowledge_service_query_repository,
|
|
27
24
|
)
|
|
28
25
|
from julee.api.requests import CreateKnowledgeServiceQueryRequest
|
|
26
|
+
from julee.domain.models import KnowledgeServiceQuery
|
|
27
|
+
from julee.domain.repositories.knowledge_service_query import (
|
|
28
|
+
KnowledgeServiceQueryRepository,
|
|
29
|
+
)
|
|
29
30
|
|
|
30
31
|
logger = logging.getLogger(__name__)
|
|
31
32
|
|
|
@@ -35,7 +36,7 @@ router = APIRouter()
|
|
|
35
36
|
|
|
36
37
|
@router.get("/", response_model=Page[KnowledgeServiceQuery])
|
|
37
38
|
async def get_knowledge_service_queries(
|
|
38
|
-
ids:
|
|
39
|
+
ids: str | None = Query(
|
|
39
40
|
None,
|
|
40
41
|
description="Comma-separated list of query IDs for bulk retrieval",
|
|
41
42
|
openapi_examples={
|
julee/api/routers/system.py
CHANGED
|
@@ -10,13 +10,14 @@ Routes defined at root level:
|
|
|
10
10
|
These routes are mounted at the root level in the main app.
|
|
11
11
|
"""
|
|
12
12
|
|
|
13
|
-
import logging
|
|
14
13
|
import asyncio
|
|
14
|
+
import logging
|
|
15
|
+
import os
|
|
15
16
|
from datetime import datetime, timezone
|
|
17
|
+
|
|
16
18
|
from fastapi import APIRouter
|
|
17
|
-
from temporalio.client import Client
|
|
18
19
|
from minio import Minio
|
|
19
|
-
import
|
|
20
|
+
from temporalio.client import Client
|
|
20
21
|
|
|
21
22
|
from julee.api.responses import (
|
|
22
23
|
HealthCheckResponse,
|
julee/api/routers/workflows.py
CHANGED
|
@@ -14,7 +14,6 @@ These routes are mounted with '/workflows' prefix in the main app.
|
|
|
14
14
|
|
|
15
15
|
import logging
|
|
16
16
|
import uuid
|
|
17
|
-
from typing import Optional
|
|
18
17
|
|
|
19
18
|
from fastapi import APIRouter, Depends, HTTPException
|
|
20
19
|
from pydantic import BaseModel, Field
|
|
@@ -22,8 +21,8 @@ from temporalio.client import Client
|
|
|
22
21
|
|
|
23
22
|
from julee.api.dependencies import get_temporal_client
|
|
24
23
|
from julee.workflows.extract_assemble import (
|
|
25
|
-
ExtractAssembleWorkflow,
|
|
26
24
|
EXTRACT_ASSEMBLE_RETRY_POLICY,
|
|
25
|
+
ExtractAssembleWorkflow,
|
|
27
26
|
)
|
|
28
27
|
|
|
29
28
|
logger = logging.getLogger(__name__)
|
|
@@ -38,7 +37,7 @@ class StartExtractAssembleRequest(BaseModel):
|
|
|
38
37
|
assembly_specification_id: str = Field(
|
|
39
38
|
..., min_length=1, description="Assembly specification ID to use"
|
|
40
39
|
)
|
|
41
|
-
workflow_id:
|
|
40
|
+
workflow_id: str | None = Field(
|
|
42
41
|
None,
|
|
43
42
|
min_length=1,
|
|
44
43
|
description=("Optional custom workflow ID (auto-generated if not provided)"),
|
|
@@ -51,8 +50,8 @@ class WorkflowStatusResponse(BaseModel):
|
|
|
51
50
|
workflow_id: str
|
|
52
51
|
run_id: str
|
|
53
52
|
status: str # "RUNNING", "COMPLETED", "FAILED", "CANCELLED", etc.
|
|
54
|
-
current_step:
|
|
55
|
-
assembly_id:
|
|
53
|
+
current_step: str | None = None
|
|
54
|
+
assembly_id: str | None = None
|
|
56
55
|
|
|
57
56
|
|
|
58
57
|
class StartWorkflowResponse(BaseModel):
|
|
@@ -11,7 +11,7 @@ to the appropriate use cases.
|
|
|
11
11
|
"""
|
|
12
12
|
|
|
13
13
|
import logging
|
|
14
|
-
from typing import
|
|
14
|
+
from typing import Any
|
|
15
15
|
|
|
16
16
|
from julee.domain.use_cases.initialize_system_data import (
|
|
17
17
|
InitializeSystemDataUseCase,
|
|
@@ -46,7 +46,7 @@ class SystemInitializationService:
|
|
|
46
46
|
self.initialize_system_data_use_case = initialize_system_data_use_case
|
|
47
47
|
self.logger = logging.getLogger("SystemInitializationService")
|
|
48
48
|
|
|
49
|
-
async def initialize(self) ->
|
|
49
|
+
async def initialize(self) -> dict[str, Any]:
|
|
50
50
|
"""
|
|
51
51
|
Initialize all required system data and configuration.
|
|
52
52
|
|
|
@@ -62,7 +62,7 @@ class SystemInitializationService:
|
|
|
62
62
|
"""
|
|
63
63
|
self.logger.info("Starting system initialization")
|
|
64
64
|
|
|
65
|
-
initialization_results:
|
|
65
|
+
initialization_results: dict[str, Any] = {
|
|
66
66
|
"status": "in_progress",
|
|
67
67
|
"tasks_completed": [],
|
|
68
68
|
"tasks_failed": [],
|
|
@@ -112,7 +112,7 @@ class SystemInitializationService:
|
|
|
112
112
|
raise
|
|
113
113
|
|
|
114
114
|
async def _execute_system_data_initialization(
|
|
115
|
-
self, results:
|
|
115
|
+
self, results: dict[str, Any]
|
|
116
116
|
) -> None:
|
|
117
117
|
"""
|
|
118
118
|
Execute system data initialization use case.
|
|
@@ -159,7 +159,7 @@ class SystemInitializationService:
|
|
|
159
159
|
|
|
160
160
|
raise
|
|
161
161
|
|
|
162
|
-
async def get_initialization_status(self) ->
|
|
162
|
+
async def get_initialization_status(self) -> dict[str, Any]:
|
|
163
163
|
"""
|
|
164
164
|
Get the current initialization status.
|
|
165
165
|
|
|
@@ -180,7 +180,7 @@ class SystemInitializationService:
|
|
|
180
180
|
"status": "ready",
|
|
181
181
|
}
|
|
182
182
|
|
|
183
|
-
async def reinitialize(self) ->
|
|
183
|
+
async def reinitialize(self) -> dict[str, Any]:
|
|
184
184
|
"""
|
|
185
185
|
Reinitialize system data.
|
|
186
186
|
|
|
@@ -6,16 +6,17 @@ endpoints, focusing on testing the router behavior with proper dependency
|
|
|
6
6
|
injection and mocking patterns.
|
|
7
7
|
"""
|
|
8
8
|
|
|
9
|
+
from collections.abc import Generator
|
|
10
|
+
|
|
9
11
|
import pytest
|
|
10
|
-
from typing import Generator
|
|
11
|
-
from fastapi.testclient import TestClient
|
|
12
12
|
from fastapi import FastAPI
|
|
13
|
+
from fastapi.testclient import TestClient
|
|
13
14
|
from fastapi_pagination import add_pagination
|
|
14
15
|
|
|
15
|
-
from julee.api.routers.assembly_specifications import router
|
|
16
16
|
from julee.api.dependencies import (
|
|
17
17
|
get_assembly_specification_repository,
|
|
18
18
|
)
|
|
19
|
+
from julee.api.routers.assembly_specifications import router
|
|
19
20
|
from julee.domain.models import (
|
|
20
21
|
AssemblySpecification,
|
|
21
22
|
AssemblySpecificationStatus,
|
|
@@ -5,15 +5,16 @@ This module provides unit tests for the documents API endpoints,
|
|
|
5
5
|
focusing on the core functionality of listing documents with pagination.
|
|
6
6
|
"""
|
|
7
7
|
|
|
8
|
-
import
|
|
8
|
+
from collections.abc import Generator
|
|
9
9
|
from datetime import datetime, timezone
|
|
10
|
-
|
|
11
|
-
|
|
10
|
+
|
|
11
|
+
import pytest
|
|
12
12
|
from fastapi import FastAPI
|
|
13
|
+
from fastapi.testclient import TestClient
|
|
13
14
|
from fastapi_pagination import add_pagination
|
|
14
15
|
|
|
15
|
-
from julee.api.routers.documents import router
|
|
16
16
|
from julee.api.dependencies import get_document_repository
|
|
17
|
+
from julee.api.routers.documents import router
|
|
17
18
|
from julee.domain.models.document import Document, DocumentStatus
|
|
18
19
|
from julee.repositories.memory import MemoryDocumentRepository
|
|
19
20
|
|
|
@@ -6,20 +6,21 @@ ensuring they follow consistent patterns with proper error handling,
|
|
|
6
6
|
pagination, and response formats.
|
|
7
7
|
"""
|
|
8
8
|
|
|
9
|
-
import
|
|
9
|
+
from collections.abc import Generator
|
|
10
|
+
from datetime import datetime, timezone
|
|
10
11
|
from unittest.mock import AsyncMock
|
|
12
|
+
|
|
13
|
+
import pytest
|
|
11
14
|
from fastapi.testclient import TestClient
|
|
12
|
-
from typing import Generator
|
|
13
15
|
|
|
14
16
|
from julee.api.app import app
|
|
17
|
+
from julee.api.dependencies import (
|
|
18
|
+
get_knowledge_service_config_repository,
|
|
19
|
+
)
|
|
15
20
|
from julee.domain.models.knowledge_service_config import (
|
|
16
21
|
KnowledgeServiceConfig,
|
|
17
22
|
ServiceApi,
|
|
18
23
|
)
|
|
19
|
-
from julee.api.dependencies import (
|
|
20
|
-
get_knowledge_service_config_repository,
|
|
21
|
-
)
|
|
22
|
-
from datetime import datetime, timezone
|
|
23
24
|
|
|
24
25
|
|
|
25
26
|
@pytest.fixture
|
|
@@ -6,16 +6,17 @@ endpoints, focusing on testing the router behavior with proper dependency
|
|
|
6
6
|
injection and mocking patterns.
|
|
7
7
|
"""
|
|
8
8
|
|
|
9
|
+
from collections.abc import Generator
|
|
10
|
+
|
|
9
11
|
import pytest
|
|
10
|
-
from typing import Generator
|
|
11
|
-
from fastapi.testclient import TestClient
|
|
12
12
|
from fastapi import FastAPI
|
|
13
|
+
from fastapi.testclient import TestClient
|
|
13
14
|
from fastapi_pagination import add_pagination
|
|
14
15
|
|
|
15
|
-
from julee.api.routers.knowledge_service_queries import router
|
|
16
16
|
from julee.api.dependencies import (
|
|
17
17
|
get_knowledge_service_query_repository,
|
|
18
18
|
)
|
|
19
|
+
from julee.api.routers.knowledge_service_queries import router
|
|
19
20
|
from julee.domain.models import KnowledgeServiceQuery
|
|
20
21
|
from julee.repositories.memory import (
|
|
21
22
|
MemoryKnowledgeServiceQueryRepository,
|
|
@@ -5,16 +5,17 @@ This module provides tests for system-level endpoints including health checks
|
|
|
5
5
|
and other operational endpoints.
|
|
6
6
|
"""
|
|
7
7
|
|
|
8
|
-
import pytest
|
|
9
8
|
import time
|
|
9
|
+
from collections.abc import Generator
|
|
10
10
|
from datetime import datetime
|
|
11
|
-
from typing import Generator
|
|
12
11
|
from unittest.mock import patch
|
|
13
|
-
|
|
12
|
+
|
|
13
|
+
import pytest
|
|
14
14
|
from fastapi import FastAPI
|
|
15
|
+
from fastapi.testclient import TestClient
|
|
15
16
|
|
|
16
|
-
from julee.api.routers.system import router
|
|
17
17
|
from julee.api.responses import ServiceStatus
|
|
18
|
+
from julee.api.routers.system import router
|
|
18
19
|
|
|
19
20
|
|
|
20
21
|
@pytest.fixture
|
|
@@ -5,15 +5,16 @@ This module provides unit tests for the workflows API endpoints,
|
|
|
5
5
|
focusing on workflow triggering, status monitoring, and error handling.
|
|
6
6
|
"""
|
|
7
7
|
|
|
8
|
-
import
|
|
9
|
-
from typing import Generator
|
|
8
|
+
from collections.abc import Generator
|
|
10
9
|
from unittest.mock import AsyncMock, MagicMock
|
|
11
|
-
|
|
10
|
+
|
|
11
|
+
import pytest
|
|
12
12
|
from fastapi import FastAPI
|
|
13
|
+
from fastapi.testclient import TestClient
|
|
13
14
|
from fastapi_pagination import add_pagination
|
|
14
15
|
|
|
15
|
-
from julee.api.routers.workflows import router
|
|
16
16
|
from julee.api.dependencies import get_temporal_client
|
|
17
|
+
from julee.api.routers.workflows import router
|
|
17
18
|
|
|
18
19
|
|
|
19
20
|
@pytest.fixture
|
julee/api/tests/test_app.py
CHANGED
|
@@ -5,16 +5,18 @@ This module provides tests for the API endpoints, focusing on testing the
|
|
|
5
5
|
HTTP layer behavior with proper dependency injection and mocking patterns.
|
|
6
6
|
"""
|
|
7
7
|
|
|
8
|
-
import
|
|
9
|
-
from typing import Generator
|
|
8
|
+
from collections.abc import Generator
|
|
10
9
|
from unittest.mock import patch
|
|
10
|
+
|
|
11
|
+
import pytest
|
|
11
12
|
from fastapi.testclient import TestClient
|
|
12
13
|
|
|
13
14
|
from julee.api.app import app
|
|
14
15
|
from julee.api.dependencies import (
|
|
15
|
-
get_knowledge_service_query_repository,
|
|
16
16
|
get_knowledge_service_config_repository,
|
|
17
|
+
get_knowledge_service_query_repository,
|
|
17
18
|
)
|
|
19
|
+
from julee.api.responses import ServiceStatus
|
|
18
20
|
from julee.domain.models import KnowledgeServiceQuery
|
|
19
21
|
from julee.repositories.memory import (
|
|
20
22
|
MemoryKnowledgeServiceQueryRepository,
|
|
@@ -22,7 +24,6 @@ from julee.repositories.memory import (
|
|
|
22
24
|
from julee.repositories.memory.knowledge_service_config import (
|
|
23
25
|
MemoryKnowledgeServiceConfigRepository,
|
|
24
26
|
)
|
|
25
|
-
from julee.api.responses import ServiceStatus
|
|
26
27
|
|
|
27
28
|
|
|
28
29
|
@pytest.fixture
|
|
@@ -6,12 +6,13 @@ StartupDependenciesProvider that provides clean access to dependencies
|
|
|
6
6
|
during application startup without exposing internal container details.
|
|
7
7
|
"""
|
|
8
8
|
|
|
9
|
-
import pytest
|
|
10
9
|
from unittest.mock import AsyncMock, MagicMock
|
|
11
10
|
|
|
11
|
+
import pytest
|
|
12
|
+
|
|
12
13
|
from julee.api.dependencies import (
|
|
13
|
-
StartupDependenciesProvider,
|
|
14
14
|
DependencyContainer,
|
|
15
|
+
StartupDependenciesProvider,
|
|
15
16
|
get_startup_dependencies,
|
|
16
17
|
)
|
|
17
18
|
|
julee/api/tests/test_requests.py
CHANGED
|
@@ -6,8 +6,9 @@ focus on verifying the delegation works correctly and that the API-specific
|
|
|
6
6
|
behavior (like field copying and conversion methods) functions as expected.
|
|
7
7
|
"""
|
|
8
8
|
|
|
9
|
-
import pytest
|
|
10
9
|
from datetime import datetime
|
|
10
|
+
|
|
11
|
+
import pytest
|
|
11
12
|
from pydantic import ValidationError
|
|
12
13
|
|
|
13
14
|
from julee.api.requests import (
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Julee Contrib Modules.
|
|
3
|
+
|
|
4
|
+
This package contains "contrib" modules - ready-made, batteries-included
|
|
5
|
+
components that solutions can import and use. These modules follow the same
|
|
6
|
+
clean architecture patterns as external Julee solutions.
|
|
7
|
+
|
|
8
|
+
Contrib modules are accelerators - reusable bounded contexts that can be
|
|
9
|
+
imported and composed into larger solutions.
|
|
10
|
+
"""
|
|
11
|
+
|
|
12
|
+
# Currently available contrib modules will be imported here as they are added
|
|
13
|
+
# For now, this serves as the namespace package root
|
|
14
|
+
|
|
15
|
+
__all__ = []
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Polling Contrib Module.
|
|
3
|
+
|
|
4
|
+
This module provides ready-made polling functionality for external endpoints.
|
|
5
|
+
It follows the Julee contrib module pattern, providing a complete polling
|
|
6
|
+
solution that can be imported and used by Julee solutions.
|
|
7
|
+
|
|
8
|
+
The polling module includes:
|
|
9
|
+
- Domain models for polling configuration and results
|
|
10
|
+
- Service protocols for polling operations
|
|
11
|
+
- HTTP implementation for REST API polling
|
|
12
|
+
- Co-located tests and examples
|
|
13
|
+
|
|
14
|
+
Example usage:
|
|
15
|
+
from julee.contrib.polling import PollingConfig, HttpPollerService
|
|
16
|
+
from julee.contrib.polling import PollingProtocol, PollingResult
|
|
17
|
+
|
|
18
|
+
# Configure polling
|
|
19
|
+
config = PollingConfig(
|
|
20
|
+
endpoint_identifier="api-v1",
|
|
21
|
+
polling_protocol=PollingProtocol.HTTP,
|
|
22
|
+
connection_params={"url": "https://api.example.com/data"},
|
|
23
|
+
timeout_seconds=30
|
|
24
|
+
)
|
|
25
|
+
|
|
26
|
+
# Poll the endpoint
|
|
27
|
+
service = HttpPollerService()
|
|
28
|
+
result = await service.poll_endpoint(config)
|
|
29
|
+
"""
|
|
30
|
+
|
|
31
|
+
from .domain import PollerService, PollingConfig, PollingProtocol, PollingResult
|
|
32
|
+
from .infrastructure import HttpPollerService, TemporalPollerService
|
|
33
|
+
from .infrastructure.temporal import WorkflowPollerServiceProxy
|
|
34
|
+
|
|
35
|
+
__all__ = [
|
|
36
|
+
# Domain models
|
|
37
|
+
"PollingConfig",
|
|
38
|
+
"PollingProtocol",
|
|
39
|
+
"PollingResult",
|
|
40
|
+
# Domain services
|
|
41
|
+
"PollerService",
|
|
42
|
+
# Infrastructure implementations
|
|
43
|
+
"HttpPollerService",
|
|
44
|
+
# Temporal integration
|
|
45
|
+
"TemporalPollerService",
|
|
46
|
+
"WorkflowPollerServiceProxy",
|
|
47
|
+
]
|