Spaces:
Running
Running
Jeremiah Lowin commited on
Commit ·
4351aa1
1
Parent(s): 0bb59f7
Remove ABC
Browse files
src/fastmcp/tools/tool.py
CHANGED
|
@@ -2,7 +2,6 @@ from __future__ import annotations
|
|
| 2 |
|
| 3 |
import inspect
|
| 4 |
import json
|
| 5 |
-
from abc import ABC, abstractmethod
|
| 6 |
from collections.abc import Callable
|
| 7 |
from dataclasses import dataclass
|
| 8 |
from typing import TYPE_CHECKING, Any
|
|
@@ -33,7 +32,7 @@ def default_serializer(data: Any) -> str:
|
|
| 33 |
return pydantic_core.to_json(data, fallback=str, indent=2).decode()
|
| 34 |
|
| 35 |
|
| 36 |
-
class Tool(FastMCPComponent
|
| 37 |
"""Internal tool registration info."""
|
| 38 |
|
| 39 |
parameters: dict[str, Any] = Field(description="JSON schema for tool parameters")
|
|
@@ -76,7 +75,6 @@ class Tool(FastMCPComponent, ABC):
|
|
| 76 |
enabled=enabled,
|
| 77 |
)
|
| 78 |
|
| 79 |
-
@abstractmethod
|
| 80 |
async def run(
|
| 81 |
self, arguments: dict[str, Any]
|
| 82 |
) -> list[TextContent | ImageContent | EmbeddedResource]:
|
|
|
|
| 2 |
|
| 3 |
import inspect
|
| 4 |
import json
|
|
|
|
| 5 |
from collections.abc import Callable
|
| 6 |
from dataclasses import dataclass
|
| 7 |
from typing import TYPE_CHECKING, Any
|
|
|
|
| 32 |
return pydantic_core.to_json(data, fallback=str, indent=2).decode()
|
| 33 |
|
| 34 |
|
| 35 |
+
class Tool(FastMCPComponent):
|
| 36 |
"""Internal tool registration info."""
|
| 37 |
|
| 38 |
parameters: dict[str, Any] = Field(description="JSON schema for tool parameters")
|
|
|
|
| 75 |
enabled=enabled,
|
| 76 |
)
|
| 77 |
|
|
|
|
| 78 |
async def run(
|
| 79 |
self, arguments: dict[str, Any]
|
| 80 |
) -> list[TextContent | ImageContent | EmbeddedResource]:
|