fabricatio 0.3.15.dev5__cp313-cp313-win_amd64.whl → 0.4.0.dev0__cp313-cp313-win_amd64.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.
Files changed (62) hide show
  1. fabricatio/__init__.py +8 -9
  2. fabricatio/rust.cp313-win_amd64.pyd +0 -0
  3. fabricatio/toolboxes/arithmetic.py +1 -1
  4. fabricatio/toolboxes/fs.py +2 -2
  5. fabricatio/workflows/rag.py +2 -1
  6. fabricatio-0.4.0.dev0.data/scripts/tdown.exe +0 -0
  7. {fabricatio-0.3.15.dev5.dist-info → fabricatio-0.4.0.dev0.dist-info}/METADATA +22 -16
  8. fabricatio-0.4.0.dev0.dist-info/RECORD +13 -0
  9. fabricatio/actions/__init__.py +0 -1
  10. fabricatio/actions/article.py +0 -415
  11. fabricatio/actions/article_rag.py +0 -407
  12. fabricatio/actions/fs.py +0 -25
  13. fabricatio/actions/output.py +0 -247
  14. fabricatio/actions/rag.py +0 -96
  15. fabricatio/actions/rules.py +0 -83
  16. fabricatio/capabilities/__init__.py +0 -1
  17. fabricatio/capabilities/advanced_judge.py +0 -20
  18. fabricatio/capabilities/advanced_rag.py +0 -61
  19. fabricatio/capabilities/censor.py +0 -105
  20. fabricatio/capabilities/check.py +0 -212
  21. fabricatio/capabilities/correct.py +0 -228
  22. fabricatio/capabilities/extract.py +0 -74
  23. fabricatio/capabilities/propose.py +0 -65
  24. fabricatio/capabilities/rag.py +0 -264
  25. fabricatio/capabilities/rating.py +0 -404
  26. fabricatio/capabilities/review.py +0 -114
  27. fabricatio/capabilities/task.py +0 -113
  28. fabricatio/decorators.py +0 -253
  29. fabricatio/emitter.py +0 -177
  30. fabricatio/fs/__init__.py +0 -35
  31. fabricatio/fs/curd.py +0 -153
  32. fabricatio/fs/readers.py +0 -61
  33. fabricatio/journal.py +0 -12
  34. fabricatio/models/action.py +0 -263
  35. fabricatio/models/adv_kwargs_types.py +0 -63
  36. fabricatio/models/extra/__init__.py +0 -1
  37. fabricatio/models/extra/advanced_judge.py +0 -32
  38. fabricatio/models/extra/aricle_rag.py +0 -286
  39. fabricatio/models/extra/article_base.py +0 -488
  40. fabricatio/models/extra/article_essence.py +0 -98
  41. fabricatio/models/extra/article_main.py +0 -285
  42. fabricatio/models/extra/article_outline.py +0 -45
  43. fabricatio/models/extra/article_proposal.py +0 -52
  44. fabricatio/models/extra/patches.py +0 -20
  45. fabricatio/models/extra/problem.py +0 -165
  46. fabricatio/models/extra/rag.py +0 -98
  47. fabricatio/models/extra/rule.py +0 -51
  48. fabricatio/models/generic.py +0 -904
  49. fabricatio/models/kwargs_types.py +0 -121
  50. fabricatio/models/role.py +0 -156
  51. fabricatio/models/task.py +0 -310
  52. fabricatio/models/tool.py +0 -328
  53. fabricatio/models/usages.py +0 -791
  54. fabricatio/parser.py +0 -114
  55. fabricatio/rust.pyi +0 -846
  56. fabricatio/utils.py +0 -156
  57. fabricatio/workflows/articles.py +0 -24
  58. fabricatio-0.3.15.dev5.data/scripts/tdown.exe +0 -0
  59. fabricatio-0.3.15.dev5.data/scripts/ttm.exe +0 -0
  60. fabricatio-0.3.15.dev5.dist-info/RECORD +0 -63
  61. {fabricatio-0.3.15.dev5.dist-info → fabricatio-0.4.0.dev0.dist-info}/WHEEL +0 -0
  62. {fabricatio-0.3.15.dev5.dist-info → fabricatio-0.4.0.dev0.dist-info}/licenses/LICENSE +0 -0
@@ -1,121 +0,0 @@
1
- """This module contains the types for the keyword arguments of the methods in the models module."""
2
-
3
- from typing import Dict, List, NotRequired, Optional, Required, TypedDict
4
-
5
-
6
- class ChunkKwargs(TypedDict):
7
- """Configuration parameters for chunking operations."""
8
-
9
- max_chunk_size: int
10
- max_overlapping_rate: NotRequired[float]
11
-
12
-
13
- class EmbeddingKwargs(TypedDict, total=False):
14
- """Configuration parameters for text embedding operations.
15
-
16
- These settings control the behavior of embedding models that convert text
17
- to vector representations.
18
- """
19
-
20
- model: str
21
- dimensions: int
22
- timeout: int
23
- caching: bool
24
-
25
-
26
- class LLMKwargs(TypedDict, total=False):
27
- """Configuration parameters for language model inference.
28
-
29
- These arguments control the behavior of large language model calls,
30
- including generation parameters and caching options.
31
- """
32
-
33
- model: Optional[str]
34
- temperature: float
35
- stop: str | list[str]
36
- top_p: float
37
- max_tokens: int
38
- stream: bool
39
- timeout: int
40
- max_retries: int
41
- no_cache: bool # if the req uses cache in this call
42
- no_store: bool # If store the response of this call to cache
43
- cache_ttl: int # how long the stored cache is alive, in seconds
44
- s_maxage: int # max accepted age of cached response, in seconds
45
- presence_penalty: float
46
- frequency_penalty: float
47
-
48
-
49
- class GenerateKwargs(LLMKwargs, total=False):
50
- """Arguments for content generation operations.
51
-
52
- Extends LLMKwargs with additional parameters specific to generation tasks,
53
- such as the number of generated items and the system message.
54
- """
55
-
56
- system_message: str
57
-
58
-
59
- class ValidateKwargs[T](GenerateKwargs, total=False):
60
- """Arguments for content validation operations.
61
-
62
- Extends LLMKwargs with additional parameters specific to validation tasks,
63
- such as limiting the number of validation attempts.
64
- """
65
-
66
- default: Optional[T]
67
- max_validations: int
68
-
69
-
70
- class CompositeScoreKwargs(ValidateKwargs[List[Dict[str, float]]], total=False):
71
- """Arguments for composite score generation operations.
72
-
73
- Extends GenerateKwargs with parameters for generating composite scores
74
- based on specific criteria and weights.
75
- """
76
-
77
- topic: str
78
- criteria: set[str]
79
- weights: Dict[str, float]
80
- manual: Dict[str, str]
81
-
82
-
83
- class BestKwargs(CompositeScoreKwargs, total=False):
84
- """Arguments for choose top-k operations."""
85
-
86
- k: int
87
-
88
-
89
- class ReviewInnerKwargs[T](ValidateKwargs[T], total=False):
90
- """Arguments for content review operations."""
91
-
92
- criteria: set[str]
93
-
94
-
95
- # noinspection PyTypedDict
96
- class ReviewKwargs[T](ReviewInnerKwargs[T], total=False):
97
- """Arguments for content review operations.
98
-
99
- Extends GenerateKwargs with parameters for evaluating content against
100
- specific topics and review criteria.
101
- """
102
-
103
- rating_manual: Dict[str, str]
104
- topic: Required[str]
105
-
106
-
107
- class ReferencedKwargs[T](ValidateKwargs[T], total=False):
108
- """Arguments for content review operations."""
109
-
110
- reference: str
111
-
112
-
113
- # noinspection PyTypedDict
114
- class ChooseKwargs[T](ValidateKwargs[T], total=False):
115
- """Arguments for selection operations.
116
-
117
- Extends GenerateKwargs with parameters for selecting among options,
118
- such as the number of items to choose.
119
- """
120
-
121
- k: int
fabricatio/models/role.py DELETED
@@ -1,156 +0,0 @@
1
- """Module that contains the Role class for managing workflows and their event registrations."""
2
-
3
- from functools import partial
4
- from typing import Any, Callable, Dict, Self, Type
5
-
6
- from fabricatio.emitter import env
7
- from fabricatio.journal import logger
8
- from fabricatio.models.action import WorkFlow
9
- from fabricatio.models.generic import WithBriefing
10
- from fabricatio.rust import Event
11
- from fabricatio.utils import is_subclass_of_base
12
- from pydantic import ConfigDict, Field
13
-
14
- is_toolbox_usage = partial(is_subclass_of_base, base_module="fabricatio.models.usages", base_name="ToolBoxUsage")
15
- is_scoped_config = partial(is_subclass_of_base, base_module="fabricatio.models.generic", base_name="ScopedConfig")
16
-
17
-
18
- class Role(WithBriefing):
19
- """Class that represents a role with a registry of events and workflows.
20
-
21
- A Role serves as a container for workflows, managing their registration to events
22
- and providing them with shared configuration like tools and personality.
23
- """
24
-
25
- model_config = ConfigDict(use_attribute_docstrings=True, arbitrary_types_allowed=True)
26
- name: str = ""
27
- """The name of the role."""
28
- description: str = ""
29
- """A brief description of the role's responsibilities and capabilities."""
30
-
31
- registry: Dict[Event, WorkFlow] = Field(default_factory=dict)
32
- """The registry of events and workflows."""
33
- dispatch_on_init: bool = True
34
- """Whether to dispatch registered workflows on initialization."""
35
-
36
- def model_post_init(self, __context: Any) -> None:
37
- """Initialize the role by resolving configurations and registering workflows.
38
-
39
- Args:
40
- __context: The context used for initialization
41
- """
42
- self.name = self.name or self.__class__.__name__
43
-
44
- if self.dispatch_on_init:
45
- self.resolve_configuration().dispatch()
46
-
47
- def register_workflow(self, event: Event, workflow: WorkFlow) -> Self:
48
- """Register a workflow to the role's registry."""
49
- if event in self.registry:
50
- logger.warning(
51
- f"Event `{event.collapse()}` is already registered with workflow "
52
- f"`{self.registry[event].name}`. It will be overwritten by `{workflow.name}`."
53
- )
54
- self.registry[event] = workflow
55
- return self
56
-
57
- def dispatch(self) -> Self:
58
- """Register each workflow in the registry to its corresponding event in the event bus.
59
-
60
- Returns:
61
- Self: The role instance for method chaining
62
- """
63
- for event, workflow in self.registry.items():
64
- logger.debug(f"Registering workflow: `{workflow.name}` for event: `{event.collapse()}`")
65
- env.on(event, workflow.serve)
66
- return self
67
-
68
- def resolve_configuration(self) -> Self:
69
- """Apply role-level configuration to all workflows in the registry.
70
-
71
- This includes setting up fallback configurations, injecting personality traits,
72
- and providing tool access to workflows and their steps.
73
-
74
- Returns:
75
- Self: The role instance for method chaining
76
- """
77
- for workflow in self.registry.values():
78
- logger.debug(f"Resolving config for workflow: `{workflow.name}`")
79
- self._configure_scoped_config(workflow)._configure_toolbox_usage(workflow)
80
-
81
- workflow.inject_personality(self.briefing)
82
- return self
83
-
84
- def _propagate_config(
85
- self,
86
- workflow: WorkFlow,
87
- has_capability: Callable[[Type], bool],
88
- config_method_name: str,
89
- capability_description: str,
90
- ) -> Self:
91
- """Propagates configuration from the Role to a Workflow and its Actions.
92
-
93
- This method checks if the Role, Workflow, or its Actions possess a specific
94
- capability (e.g., being a ScopedConfig or ToolBoxUsage). If they do,
95
- a specified configuration method is called on them to apply or inherit
96
- settings.
97
-
98
- The configuration flows hierarchically:
99
- 1. If the Role has the capability, it's the initial source.
100
- 2. If the Workflow also has the capability, it can inherit from the Role
101
- and then becomes the source for its Actions.
102
- 3. Actions with the capability inherit from the determined source (either
103
- Workflow or Role).
104
-
105
- Args:
106
- workflow: The WorkFlow instance to configure.
107
- has_capability: A callable that takes a Type and returns True if
108
- the type possesses the specific capability, False otherwise.
109
- config_method_name: The name of the method to call on an object
110
- (Role, Workflow, Action) to apply the configuration.
111
- For example, "fallback_to" or "supply_tools_from".
112
- capability_description: A string describing the capability, used for
113
- logging purposes (e.g., "scoped config", "toolbox usage").
114
- """
115
- # This variable will hold the object from which Actions should inherit their configuration.
116
- # It could be the Role itself or the Workflow, depending on their capabilities.
117
- config_source_for_actions = None
118
-
119
- # Check if the Role itself has the capability.
120
- if has_capability(self.__class__):
121
- # If the Role has the capability, it becomes the initial source for configuration.
122
- config_source_for_actions = self
123
-
124
- # Check if the Workflow has the capability.
125
- if has_capability(workflow.__class__):
126
- logger.debug(
127
- f"Configuring {capability_description} inherited from `{self.name}` for workflow: `{workflow.name}`"
128
- )
129
- # If the Role was already identified as a config source,
130
- # the Workflow an inherit its configuration directly from the Role.
131
- if config_source_for_actions is not None:
132
- # Call the specified configuration method on the workflow, passing the Role (self) as the source.
133
- getattr(workflow, config_method_name)(config_source_for_actions)
134
-
135
- # After potentially inheriting from the Role, the Workflow itself becomes
136
- # the source of configuration for its Actions.
137
- config_source_for_actions = workflow
138
-
139
- # If a configuration source (either Role or Workflow) has been established:
140
- if config_source_for_actions is not None:
141
- # Iterate over all actions within the workflow.
142
- # Filter for actions that possess the specified capability.
143
- for action in (act for act in workflow.iter_actions() if has_capability(act.__class__)):
144
- # Call the specified configuration method on the action,
145
- # passing the determined config_source_for_actions.
146
- getattr(action, config_method_name)(config_source_for_actions)
147
-
148
- return self
149
-
150
- def _configure_scoped_config(self, workflow: WorkFlow) -> Self:
151
- """Configure scoped configuration for workflow and its actions."""
152
- return self._propagate_config(workflow, is_scoped_config, "fallback_to", "scoped config")
153
-
154
- def _configure_toolbox_usage(self, workflow: WorkFlow) -> Self:
155
- """Configure toolbox usage for workflow and its actions."""
156
- return self._propagate_config(workflow, is_toolbox_usage, "supply_tools_from", "toolbox usage")
fabricatio/models/task.py DELETED
@@ -1,310 +0,0 @@
1
- """This module defines the `Task` class, which represents a task with a status and output.
2
-
3
- It includes methods to manage the task's lifecycle, such as starting, finishing, cancelling, and failing the task.
4
- """
5
-
6
- from asyncio import Queue
7
- from typing import Any, Dict, List, Optional, Self, Union
8
-
9
- from fabricatio.emitter import env
10
- from fabricatio.journal import logger
11
- from fabricatio.models.generic import ProposedAble, WithBriefing, WithDependency
12
- from fabricatio.rust import CONFIG, TEMPLATE_MANAGER, Event, TaskStatus
13
- from pydantic import Field, PrivateAttr
14
-
15
- type EventLike = Union[str, Event, List[str]]
16
-
17
-
18
- class Task[T](WithBriefing, ProposedAble, WithDependency):
19
- """A class representing a task with a status and output.
20
-
21
- Attributes:
22
- name (str): The name of the task.
23
- description (str): The description of the task.
24
- goals (str): The goal of the task.
25
- dependencies (List[str]): The file dependencies of the task, a list of file paths.
26
- namespace (List[str]): The namespace of the task, a list of namespace segment, as string.
27
- """
28
-
29
- name: str = Field(...)
30
- """The name of the task, which should be concise and descriptive."""
31
-
32
- description: str = Field(default="")
33
- """A detailed explanation of the task that includes all necessary information. Should be clear and answer what, why, when, where, who, and how questions."""
34
-
35
- goals: List[str] = Field(default_factory=list)
36
- """A list of objectives that the task aims to accomplish. Each goal should be clear and specific. Complex tasks should be broken into multiple smaller goals."""
37
-
38
- namespace: List[str] = Field(default_factory=list)
39
- """A list of string segments that identify the task's location in the system. If not specified, defaults to an empty list."""
40
-
41
- dependencies: List[str] = Field(default_factory=list)
42
- """A list of file paths that are needed or mentioned in the task's description (either reading or writing) to complete this task. If not specified, defaults to an empty list."""
43
-
44
- _output: Queue[T | None] = PrivateAttr(default_factory=Queue)
45
- """The output queue of the task."""
46
-
47
- _status: TaskStatus = PrivateAttr(default=TaskStatus.Pending)
48
- """The status of the task."""
49
-
50
- _namespace: Event = PrivateAttr(default_factory=Event)
51
- """The namespace of the task as an event, which is generated from the namespace list."""
52
- _extra_init_context: Dict = PrivateAttr(default_factory=dict)
53
- """Extra initialization context for the task, which is designed to override the one of the Workflow."""
54
-
55
- @property
56
- def extra_init_context(self) -> Dict:
57
- """Extra initialization context for the task, which is designed to override the one of the Workflow."""
58
- return self._extra_init_context
59
-
60
- def update_init_context(self, /, **kwargs) -> Self:
61
- """Update the extra initialization context for the task."""
62
- self.extra_init_context.update(kwargs)
63
- return self
64
-
65
- def model_post_init(self, __context: Any) -> None:
66
- """Initialize the task with a namespace event."""
67
- self._namespace.concat(self.namespace)
68
-
69
- def move_to(self, new_namespace: EventLike) -> Self:
70
- """Move the task to a new namespace.
71
-
72
- Args:
73
- new_namespace (EventLike): The new namespace to move the task to.
74
-
75
- Returns:
76
- Task: The moved instance of the `Task` class.
77
- """
78
- logger.debug(f"Moving task `{self.name}` to `{new_namespace}`")
79
- self._namespace.clear().concat(new_namespace)
80
- self.namespace = self._namespace.segments
81
- return self
82
-
83
- def nested_move_to(self, new_parent_namespace: EventLike) -> Self:
84
- """Move the task to a new namespace by nesting it under the new parent namespace.
85
-
86
- Args:
87
- new_parent_namespace (EventLike): The new parent namespace to move the task to.
88
-
89
- Returns:
90
- Task: The nested moved instance of the `Task` class.
91
- """
92
- logger.debug(f"Nested moving task `{self.name}` to `{new_parent_namespace}`")
93
- self._namespace.clear().concat(new_parent_namespace).concat(self.namespace)
94
- self.namespace = self._namespace.segments
95
- return self
96
-
97
- def update_task(self, goal: Optional[List[str] | str] = None, description: Optional[str] = None) -> Self:
98
- """Update the goal and description of the task.
99
-
100
- Args:
101
- goal (str|List[str], optional): The new goal of the task.
102
- description (str, optional): The new description of the task.
103
-
104
- Returns:
105
- Task: The updated instance of the `Task` class.
106
- """
107
- if goal:
108
- self.goals = goal if isinstance(goal, list) else [goal]
109
- if description:
110
- self.description = description
111
- return self
112
-
113
- async def get_output(self) -> T | None:
114
- """Get the output of the task.
115
-
116
- Returns:
117
- T: The output of the task.
118
- """
119
- logger.debug(f"Getting output for task {self.name}")
120
- return await self._output.get()
121
-
122
- def status_label(self, status: TaskStatus) -> str:
123
- """Return a formatted status label for the task.
124
-
125
- Args:
126
- status (fabricatio.constants.TaskStatus): The status of the task.
127
-
128
- Returns:
129
- str: The formatted status label.
130
- """
131
- return self._namespace.derive(self.name).push(status).collapse()
132
-
133
- @property
134
- def pending_label(self) -> str:
135
- """Return the pending status label for the task.
136
-
137
- Returns:
138
- str: The pending status label.
139
- """
140
- return self.status_label(TaskStatus.Pending)
141
-
142
- @property
143
- def running_label(self) -> str:
144
- """Return the running status label for the task.
145
-
146
- Returns:
147
- str: The running status label.
148
- """
149
- return self.status_label(TaskStatus.Running)
150
-
151
- @property
152
- def finished_label(self) -> str:
153
- """Return the finished status label for the task.
154
-
155
- Returns:
156
- str: The finished status label.
157
- """
158
- return self.status_label(TaskStatus.Finished)
159
-
160
- @property
161
- def failed_label(self) -> str:
162
- """Return the failed status label for the task.
163
-
164
- Returns:
165
- str: The failed status label.
166
- """
167
- return self.status_label(TaskStatus.Failed)
168
-
169
- @property
170
- def cancelled_label(self) -> str:
171
- """Return the cancelled status label for the task.
172
-
173
- Returns:
174
- str: The cancelled status label.
175
- """
176
- return self.status_label(TaskStatus.Cancelled)
177
-
178
- async def finish(self, output: T) -> Self:
179
- """Mark the task as finished and set the output.
180
-
181
- Args:
182
- output (T): The output of the task.
183
-
184
- Returns:
185
- Task: The finished instance of the `Task` class.
186
- """
187
- logger.info(f"Finishing task {self.name}")
188
- self._status = TaskStatus.Finished
189
- await self._output.put(output)
190
- logger.debug(f"Output set for task {self.name}")
191
- await env.emit_async(self.finished_label, self)
192
- logger.debug(f"Emitted finished event for task {self.name}")
193
- return self
194
-
195
- async def start(self) -> Self:
196
- """Mark the task as running.
197
-
198
- Returns:
199
- Task: The running instance of the `Task` class.
200
- """
201
- logger.info(f"Starting task `{self.name}`")
202
- self._status = TaskStatus.Running
203
- await env.emit_async(self.running_label, self)
204
- return self
205
-
206
- async def cancel(self) -> Self:
207
- """Mark the task as cancelled.
208
-
209
- Returns:
210
- Task: The cancelled instance of the `Task` class.
211
- """
212
- logger.info(f"Cancelling task `{self.name}`")
213
- self._status = TaskStatus.Cancelled
214
- await self._output.put(None)
215
- await env.emit_async(self.cancelled_label, self)
216
- return self
217
-
218
- async def fail(self) -> Self:
219
- """Mark the task as failed.
220
-
221
- Returns:
222
- Task: The failed instance of the `Task` class.
223
- """
224
- logger.info(f"Failing task `{self.name}`")
225
- self._status = TaskStatus.Failed
226
- await self._output.put(None)
227
- await env.emit_async(self.failed_label, self)
228
- return self
229
-
230
- def publish(self, new_namespace: Optional[EventLike] = None) -> Self:
231
- """Publish the task to the event bus.
232
-
233
- Args:
234
- new_namespace(EventLike, optional): The new namespace to move the task to.
235
-
236
- Returns:
237
- Task: The published instance of the `Task` class.
238
- """
239
- if new_namespace:
240
- self.move_to(new_namespace)
241
- logger.info(f"Publishing task `{(label := self.pending_label)}`")
242
- env.emit_future(label, self)
243
- return self
244
-
245
- async def delegate(self, new_namespace: Optional[EventLike] = None) -> T | None:
246
- """Delegate the task to the event.
247
-
248
- Args:
249
- new_namespace(EventLike, optional): The new namespace to move the task to.
250
-
251
- Returns:
252
- T|None: The output of the task.
253
- """
254
- if new_namespace:
255
- self.move_to(new_namespace)
256
- logger.info(f"Delegating task `{(label := self.pending_label)}`")
257
- env.emit_future(label, self)
258
- return await self.get_output()
259
-
260
- @property
261
- def briefing(self) -> str:
262
- """Return a briefing of the task including its goal.
263
-
264
- Returns:
265
- str: The briefing of the task.
266
- """
267
- return TEMPLATE_MANAGER.render_template(
268
- CONFIG.templates.task_briefing_template,
269
- self.model_dump(),
270
- )
271
-
272
- def is_running(self) -> bool:
273
- """Check if the task is running.
274
-
275
- Returns:
276
- bool: True if the task is running, False otherwise.
277
- """
278
- return self._status == TaskStatus.Running
279
-
280
- def is_finished(self) -> bool:
281
- """Check if the task is finished.
282
-
283
- Returns:
284
- bool: True if the task is finished, False otherwise.
285
- """
286
- return self._status == TaskStatus.Finished
287
-
288
- def is_failed(self) -> bool:
289
- """Check if the task is failed.
290
-
291
- Returns:
292
- bool: True if the task is failed, False otherwise.
293
- """
294
- return self._status == TaskStatus.Failed
295
-
296
- def is_cancelled(self) -> bool:
297
- """Check if the task is cancelled.
298
-
299
- Returns:
300
- bool: True if the task is cancelled, False otherwise.
301
- """
302
- return self._status == TaskStatus.Cancelled
303
-
304
- def is_pending(self) -> bool:
305
- """Check if the task is pending.
306
-
307
- Returns:
308
- bool: True if the task is pending, False otherwise.
309
- """
310
- return self._status == TaskStatus.Pending