mirror of
https://github.com/PrefectHQ/fastmcp.git
synced 2026-08-21 21:14:17 +02:00
Merge pull request #710 from jlowin/deprecation-stack
Ensure deprecation warnings have stacklevel=2
This commit is contained in:
commit
c0e1d1fa71
3 changed files with 4 additions and 0 deletions
|
|
@ -60,6 +60,7 @@ class PromptManager:
|
|||
warnings.warn(
|
||||
"PromptManager.add_prompt_from_fn() is deprecated. Use Prompt.from_function() and call add_prompt() instead.",
|
||||
DeprecationWarning,
|
||||
stacklevel=2,
|
||||
)
|
||||
prompt = FunctionPrompt.from_function(
|
||||
fn, name=name, description=description, tags=tags
|
||||
|
|
|
|||
|
|
@ -125,6 +125,7 @@ class ResourceManager:
|
|||
warnings.warn(
|
||||
"add_resource_from_fn is deprecated. Use Resource.from_function() and call add_resource() instead.",
|
||||
DeprecationWarning,
|
||||
stacklevel=2,
|
||||
)
|
||||
resource = Resource.from_function(
|
||||
fn=fn,
|
||||
|
|
@ -181,6 +182,7 @@ class ResourceManager:
|
|||
warnings.warn(
|
||||
"add_template_from_fn is deprecated. Use ResourceTemplate.from_function() and call add_template() instead.",
|
||||
DeprecationWarning,
|
||||
stacklevel=2,
|
||||
)
|
||||
template = ResourceTemplate.from_function(
|
||||
fn,
|
||||
|
|
|
|||
|
|
@ -73,6 +73,7 @@ class ToolManager:
|
|||
warnings.warn(
|
||||
"ToolManager.add_tool_from_fn() is deprecated. Use Tool.from_function() and call add_tool() instead.",
|
||||
DeprecationWarning,
|
||||
stacklevel=2,
|
||||
)
|
||||
tool = Tool.from_function(
|
||||
fn,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue