Jeremiah Lowin commited on
Commit
03bb111
·
2 Parent(s): c845368bb713f2

Merge branch 'parent-depth' into elicitation

Browse files
Files changed (1) hide show
  1. src/fastmcp/utilities/types.py +4 -1
src/fastmcp/utilities/types.py CHANGED
@@ -38,8 +38,11 @@ def get_cached_typeadapter(cls: T) -> TypeAdapter[T]:
38
  create them once in a global scope and reuse them as often as possible.
39
  However, this isn't feasible for user-generated functions. Instead, we use a
40
  cache to minimize the cost of creating them as much as possible.
 
 
 
41
  """
42
- return TypeAdapter(cls)
43
 
44
 
45
  def issubclass_safe(cls: type, base: type) -> bool:
 
38
  create them once in a global scope and reuse them as often as possible.
39
  However, this isn't feasible for user-generated functions. Instead, we use a
40
  cache to minimize the cost of creating them as much as possible.
41
+
42
+ The _parent_depth is set to 3 to look at an additional frame, since this
43
+ function is in its own scope.
44
  """
45
+ return TypeAdapter(cls, _parent_depth=3)
46
 
47
 
48
  def issubclass_safe(cls: type, base: type) -> bool: