Merge branch 'main' into positional-arg-version

This commit is contained in:
Jeremiah Lowin 2025-06-16 10:01:43 -04:00 committed by GitHub
commit 503e16ef31
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 4 additions and 4 deletions

View file

@ -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):

View file

@ -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,

View file

@ -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):

View file

@ -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):