CfirTsabari commited on
Commit
3c230a8
·
1 Parent(s): 3218844

Fix type hints for FunctionResource:fn

Browse files
Files changed (1) hide show
  1. src/fastmcp/resources/resource.py +3 -3
src/fastmcp/resources/resource.py CHANGED
@@ -62,7 +62,7 @@ class Resource(FastMCPComponent, abc.ABC):
62
 
63
  @staticmethod
64
  def from_function(
65
- fn: Callable[[], Any],
66
  uri: str | AnyUrl,
67
  name: str | None = None,
68
  title: str | None = None,
@@ -144,12 +144,12 @@ class FunctionResource(Resource):
144
  - other types will be converted to JSON
145
  """
146
 
147
- fn: Callable[[], Any]
148
 
149
  @classmethod
150
  def from_function(
151
  cls,
152
- fn: Callable[[], Any],
153
  uri: str | AnyUrl,
154
  name: str | None = None,
155
  title: str | None = None,
 
62
 
63
  @staticmethod
64
  def from_function(
65
+ fn: Callable[..., Any],
66
  uri: str | AnyUrl,
67
  name: str | None = None,
68
  title: str | None = None,
 
144
  - other types will be converted to JSON
145
  """
146
 
147
+ fn: Callable[..., Any]
148
 
149
  @classmethod
150
  def from_function(
151
  cls,
152
+ fn: Callable[..., Any],
153
  uri: str | AnyUrl,
154
  name: str | None = None,
155
  title: str | None = None,