mirror of
https://github.com/aljazceru/mcp-python-sdk.git
synced 2025-12-19 14:54:24 +01:00
Close unclosed resources in the whole project (#267)
* Close resources * Close all resources * Update pyproject.toml * Close all resources * Close all resources * try now... * try to ignore this * try again * try adding one more.. * try now * try now * revert ci changes
This commit is contained in:
committed by
GitHub
parent
1691b905e2
commit
94d326dbf1
@@ -18,10 +18,10 @@ if TYPE_CHECKING:
|
||||
class Tool(BaseModel):
|
||||
"""Internal tool registration info."""
|
||||
|
||||
fn: Callable = Field(exclude=True)
|
||||
fn: Callable[..., Any] = Field(exclude=True)
|
||||
name: str = Field(description="Name of the tool")
|
||||
description: str = Field(description="Description of what the tool does")
|
||||
parameters: dict = Field(description="JSON schema for tool parameters")
|
||||
parameters: dict[str, Any] = Field(description="JSON schema for tool parameters")
|
||||
fn_metadata: FuncMetadata = Field(
|
||||
description="Metadata about the function including a pydantic model for tool"
|
||||
" arguments"
|
||||
@@ -34,7 +34,7 @@ class Tool(BaseModel):
|
||||
@classmethod
|
||||
def from_function(
|
||||
cls,
|
||||
fn: Callable,
|
||||
fn: Callable[..., Any],
|
||||
name: str | None = None,
|
||||
description: str | None = None,
|
||||
context_kwarg: str | None = None,
|
||||
|
||||
@@ -102,7 +102,9 @@ class FuncMetadata(BaseModel):
|
||||
)
|
||||
|
||||
|
||||
def func_metadata(func: Callable, skip_names: Sequence[str] = ()) -> FuncMetadata:
|
||||
def func_metadata(
|
||||
func: Callable[..., Any], skip_names: Sequence[str] = ()
|
||||
) -> FuncMetadata:
|
||||
"""Given a function, return metadata including a pydantic model representing its
|
||||
signature.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user