mirror of
https://github.com/PrefectHQ/fastmcp.git
synced 2026-08-22 21:44:18 +02:00
Add enabled property to components
This commit is contained in:
parent
b01eb02a88
commit
244501a6a6
1 changed files with 13 additions and 0 deletions
|
|
@ -32,6 +32,11 @@ class FastMCPComponent(FastMCPBaseModel):
|
|||
description="Tags for the component.",
|
||||
)
|
||||
|
||||
enabled: bool = Field(
|
||||
default=True,
|
||||
description="Whether the component is enabled.",
|
||||
)
|
||||
|
||||
def __eq__(self, other: object) -> bool:
|
||||
if type(self) is not type(other):
|
||||
return False
|
||||
|
|
@ -40,3 +45,11 @@ class FastMCPComponent(FastMCPBaseModel):
|
|||
|
||||
def __repr__(self) -> str:
|
||||
return f"{self.__class__.__name__}(name={self.name!r}, description={self.description!r}, tags={self.tags})"
|
||||
|
||||
def enable(self) -> None:
|
||||
"""Enable the component."""
|
||||
self.enabled = True
|
||||
|
||||
def disable(self) -> None:
|
||||
"""Disable the component."""
|
||||
self.enabled = False
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue