mirror of
https://github.com/PrefectHQ/fastmcp.git
synced 2026-08-22 21:44:18 +02:00
Merge pull request #845 from zfflxx/main
fix tool description indentation issue #844 https://github.com/jlowin…
This commit is contained in:
commit
ab4d88d15e
4 changed files with 4 additions and 4 deletions
|
|
@ -155,7 +155,7 @@ class FunctionPrompt(Prompt):
|
|||
if param.kind == inspect.Parameter.VAR_KEYWORD:
|
||||
raise ValueError("Functions with **kwargs are not supported as prompts")
|
||||
|
||||
description = description or fn.__doc__
|
||||
description = description or inspect.getdoc(fn)
|
||||
|
||||
# if the fn is a callable class, we need to get the __call__ method from here out
|
||||
if not inspect.isroutine(fn):
|
||||
|
|
|
|||
|
|
@ -135,7 +135,7 @@ class FunctionResource(Resource):
|
|||
fn=fn,
|
||||
uri=uri,
|
||||
name=name or fn.__name__,
|
||||
description=description or fn.__doc__,
|
||||
description=description or inspect.getdoc(fn),
|
||||
mime_type=mime_type or "text/plain",
|
||||
tags=tags or set(),
|
||||
enabled=enabled if enabled is not None else True,
|
||||
|
|
|
|||
|
|
@ -214,7 +214,7 @@ class FunctionResourceTemplate(ResourceTemplate):
|
|||
f"URI parameters {uri_params} must be a subset of the function arguments: {func_params}"
|
||||
)
|
||||
|
||||
description = description or fn.__doc__
|
||||
description = description or inspect.getdoc(fn)
|
||||
|
||||
# if the fn is a callable class, we need to get the __call__ method from here out
|
||||
if not inspect.isroutine(fn):
|
||||
|
|
|
|||
|
|
@ -231,7 +231,7 @@ class ParsedFunction:
|
|||
|
||||
# collect name and doc before we potentially modify the function
|
||||
fn_name = getattr(fn, "__name__", None) or fn.__class__.__name__
|
||||
fn_doc = fn.__doc__
|
||||
fn_doc = inspect.getdoc(fn)
|
||||
|
||||
# if the fn is a callable class, we need to get the __call__ method from here out
|
||||
if not inspect.isroutine(fn):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue