Update schema

This commit is contained in:
rafid saad
2026-02-02 16:34:02 -08:00
parent 193e128c20
commit cfc595ac62
2 changed files with 18 additions and 3 deletions
+15 -3
View File
@@ -2984,8 +2984,9 @@ class CronClient:
webhook: str | None = None,
multitask_strategy: str | None = None,
end_time: datetime | None = None,
is_enabled: bool | None = None,
headers: Mapping[str, str] | None = None,
params: QueryParamTypes | None = None,
params: QueryParamTypes | None = None
) -> Run:
"""Create a cron job for a thread.
@@ -3009,6 +3010,7 @@ class CronClient:
multitask_strategy: Multitask strategy to use.
Must be one of 'reject', 'interrupt', 'rollback', or 'enqueue'.
end_time: The time to stop running the cron job. If not provided, the cron job will run indefinitely.
is_enabled: Whether the cron job is enabled or not.
headers: Optional custom headers to include with the request.
params: Optional query parameters to include with the request.
@@ -3029,7 +3031,8 @@ class CronClient:
interrupt_before=["node_to_stop_before_1","node_to_stop_before_2"],
interrupt_after=["node_to_stop_after_1","node_to_stop_after_2"],
webhook="https://my.fake.webhook.com",
multitask_strategy="interrupt"
multitask_strategy="interrupt",
is_enabled=True,
)
```
"""
@@ -3045,6 +3048,7 @@ class CronClient:
"interrupt_after": interrupt_after,
"webhook": webhook,
"end_time": end_time.isoformat() if end_time else None,
"is_enabled": is_enabled if is_enabled is not None else True,
}
if multitask_strategy:
payload["multitask_strategy"] = multitask_strategy
@@ -3072,6 +3076,7 @@ class CronClient:
on_run_completed: OnCompletionBehavior | None = None,
multitask_strategy: str | None = None,
end_time: datetime | None = None,
is_enabled: bool | None = None,
headers: Mapping[str, str] | None = None,
params: QueryParamTypes | None = None,
) -> Run:
@@ -3098,6 +3103,7 @@ class CronClient:
multitask_strategy: Multitask strategy to use.
Must be one of 'reject', 'interrupt', 'rollback', or 'enqueue'.
end_time: The time to stop running the cron job. If not provided, the cron job will run indefinitely.
is_enabled: Whether the cron job is enabled or not.
headers: Optional custom headers to include with the request.
params: Optional query parameters to include with the request.
@@ -3117,7 +3123,8 @@ class CronClient:
interrupt_before=["node_to_stop_before_1","node_to_stop_before_2"],
interrupt_after=["node_to_stop_after_1","node_to_stop_after_2"],
webhook="https://my.fake.webhook.com",
multitask_strategy="interrupt"
multitask_strategy="interrupt",
is_enabled=True,
)
```
@@ -3135,6 +3142,7 @@ class CronClient:
"webhook": webhook,
"on_run_completed": on_run_completed,
"end_time": end_time.isoformat() if end_time else None,
"is_enabled": is_enabled if is_enabled is not None else True,
}
if multitask_strategy:
payload["multitask_strategy"] = multitask_strategy
@@ -3177,6 +3185,7 @@ class CronClient:
*,
assistant_id: str | None = None,
thread_id: str | None = None,
is_enabled: bool | None = None,
limit: int = 10,
offset: int = 0,
sort_by: CronSortBy | None = None,
@@ -3190,6 +3199,7 @@ class CronClient:
Args:
assistant_id: The assistant ID or graph name to search for.
thread_id: the thread ID to search for.
is_enabled: The enabled status to search for.
limit: The maximum number of results to return.
offset: The number of results to skip.
headers: Optional custom headers to include with the request.
@@ -3205,6 +3215,7 @@ class CronClient:
cron_jobs = await client.crons.search(
assistant_id="my_assistant_id",
thread_id="my_thread_id",
is_enabled=True,
limit=5,
offset=5,
)
@@ -3239,6 +3250,7 @@ class CronClient:
payload = {
"assistant_id": assistant_id,
"thread_id": thread_id,
"is_enabled": is_enabled,
"limit": limit,
"offset": offset,
}
+3
View File
@@ -372,6 +372,8 @@ class Cron(TypedDict):
"""The next run date of the cron."""
metadata: dict
"""The metadata of the cron."""
is_enabled: bool
"""Whether the cron is enabled."""
# Select field aliases for client-side typing of `select` parameters.
@@ -428,6 +430,7 @@ CronSelectField = Literal[
"metadata",
"now",
"on_run_completed",
"is_enabled",
]
PrimitiveData = str | int | float | bool | None