ivcap-lambda 0.8.6__tar.gz → 0.8.7__tar.gz
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.
- {ivcap_lambda-0.8.6 → ivcap_lambda-0.8.7}/PKG-INFO +1 -1
- {ivcap_lambda-0.8.6 → ivcap_lambda-0.8.7}/ivcap_lambda/builder.py +4 -3
- {ivcap_lambda-0.8.6 → ivcap_lambda-0.8.7}/ivcap_lambda/health_handler.py +9 -4
- {ivcap_lambda-0.8.6 → ivcap_lambda-0.8.7}/pyproject.toml +1 -1
- {ivcap_lambda-0.8.6 → ivcap_lambda-0.8.7}/AUTHORS.md +0 -0
- {ivcap_lambda-0.8.6 → ivcap_lambda-0.8.7}/LICENSE +0 -0
- {ivcap_lambda-0.8.6 → ivcap_lambda-0.8.7}/README.md +0 -0
- {ivcap_lambda-0.8.6 → ivcap_lambda-0.8.7}/ivcap_lambda/__init__.py +0 -0
- {ivcap_lambda-0.8.6 → ivcap_lambda-0.8.7}/ivcap_lambda/decorators.py +0 -0
- {ivcap_lambda-0.8.6 → ivcap_lambda-0.8.7}/ivcap_lambda/executor.py +0 -0
- {ivcap_lambda-0.8.6 → ivcap_lambda-0.8.7}/ivcap_lambda/logger.py +0 -0
- {ivcap_lambda-0.8.6 → ivcap_lambda-0.8.7}/ivcap_lambda/logging.json +0 -0
- {ivcap_lambda-0.8.6 → ivcap_lambda-0.8.7}/ivcap_lambda/mcp.py +0 -0
- {ivcap_lambda-0.8.6 → ivcap_lambda-0.8.7}/ivcap_lambda/py.typed +0 -0
- {ivcap_lambda-0.8.6 → ivcap_lambda-0.8.7}/ivcap_lambda/secret.py +0 -0
- {ivcap_lambda-0.8.6 → ivcap_lambda-0.8.7}/ivcap_lambda/server.py +0 -0
- {ivcap_lambda-0.8.6 → ivcap_lambda-0.8.7}/ivcap_lambda/service_definition.py +0 -0
- {ivcap_lambda-0.8.6 → ivcap_lambda-0.8.7}/ivcap_lambda/utils.py +0 -0
- {ivcap_lambda-0.8.6 → ivcap_lambda-0.8.7}/ivcap_lambda/version.py +0 -0
|
@@ -65,11 +65,12 @@ class ToolOptions(BaseModel):
|
|
|
65
65
|
service_id: str | None = Field(
|
|
66
66
|
None, description="overriding the default service id"
|
|
67
67
|
)
|
|
68
|
-
is_ready: Callable[[], bool | dict[str, Any]] | None = Field(
|
|
68
|
+
is_ready: Callable[[], bool | dict[str, Any] | BaseModel] | None = Field(
|
|
69
69
|
None,
|
|
70
70
|
description=(
|
|
71
|
-
"Readiness check. Return a dict of info to report on
|
|
72
|
-
"return False, or raise NotReadyYet(retry_after)
|
|
71
|
+
"Readiness check. Return a dict or pydantic model of info to report on "
|
|
72
|
+
"/_healtz (or True), return False, or raise NotReadyYet(retry_after) "
|
|
73
|
+
"while not ready"
|
|
73
74
|
),
|
|
74
75
|
)
|
|
75
76
|
|
|
@@ -7,13 +7,15 @@ from collections.abc import Awaitable, Callable
|
|
|
7
7
|
from typing import Any
|
|
8
8
|
|
|
9
9
|
from fastapi import FastAPI, HTTPException
|
|
10
|
+
from pydantic import BaseModel
|
|
10
11
|
|
|
11
12
|
from .utils import find_first
|
|
12
13
|
|
|
13
|
-
# A readiness check returns True (ready), False (legacy not-ready),
|
|
14
|
-
# extra info to add to the health reply (ready). Raising
|
|
15
|
-
# not-ready. Sync or async.
|
|
16
|
-
|
|
14
|
+
# A readiness check returns True (ready), False (legacy not-ready), a dict or a
|
|
15
|
+
# pydantic model of extra info to add to the health reply (ready). Raising
|
|
16
|
+
# NotReadyYet also means not-ready. Sync or async.
|
|
17
|
+
ReadyResult = bool | dict[str, Any] | BaseModel
|
|
18
|
+
ReadyFn = Callable[[], ReadyResult | Awaitable[ReadyResult]]
|
|
17
19
|
|
|
18
20
|
# Global registry of readiness handlers
|
|
19
21
|
_ready_handlers: list[ReadyFn] = []
|
|
@@ -68,6 +70,9 @@ async def healtz_handler() -> dict:
|
|
|
68
70
|
retry_after = max(retry_after or 0.0, ex.retry_after)
|
|
69
71
|
continue
|
|
70
72
|
|
|
73
|
+
if isinstance(result, BaseModel):
|
|
74
|
+
result = result.model_dump(by_alias=True)
|
|
75
|
+
|
|
71
76
|
if isinstance(result, dict):
|
|
72
77
|
info.update(result)
|
|
73
78
|
elif not result:
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|