Skip to content

Conversation

@Steve-Dusty
Copy link
Contributor

@Steve-Dusty Steve-Dusty commented Nov 1, 2025

Thank you for contributing to Swarms!

Replace this comment with:

  • Description: a description of the change,
  • Issue: the issue # it fixes (if applicable),
  • Dependencies: any dependencies required for this change,
  • Tag maintainer: for a quicker response, tag the relevant maintainer (see below),
  • Twitter handle: we announce bigger features on Twitter. If your PR gets announced and you'd like a mention, we'll gladly shout you out!

Please make sure your PR is passing linting and testing before submitting. Run make format, make lint and make test to check this locally.

See contribution guidelines for more information on how to write/run tests, lint, etc:
https://github.com/kyegomez/swarms/blob/master/CONTRIBUTING.md

If you're adding a new integration, please include:

  1. a test for the integration, preferably unit tests that do not rely on network access,
  2. an example notebook showing its use.

Maintainer responsibilities:

If no one reviews your PR within a few days, feel free to email Kye at [email protected]

See contribution guidelines for more information on how to write/run tests, lint, etc: https://github.com/kyegomez/swarms


📚 Documentation preview 📚: https://swarms--1175.org.readthedocs.build/en/1175/

Then test with your MCP client or directly via HTTP.
"""

from dotenv import load_dotenv

Check failure

Code scanning / Pyre

Undefined import

Undefined import [21]: Could not find a module corresponding to import `dotenv`.

from loguru import logger
from mcp.server.fastmcp import FastMCP
from pydantic import BaseModel, Field

Check failure

Code scanning / Pyre

Undefined import

Undefined import [21]: Could not find a module corresponding to import `pydantic`.

# Optional x402 and Starlette imports
try:
from starlette.middleware.base import BaseHTTPMiddleware

Check failure

Code scanning / Pyre

Undefined import

Undefined import [21]: Could not find a module corresponding to import `starlette.middleware.base`.
# Optional x402 and Starlette imports
try:
from starlette.middleware.base import BaseHTTPMiddleware
from starlette.requests import Request

Check failure

Code scanning / Pyre

Undefined import

Undefined import [21]: Could not find a module corresponding to import `starlette.requests`.
try:
from starlette.middleware.base import BaseHTTPMiddleware
from starlette.requests import Request
from x402.fastapi.middleware import require_payment

Check failure

Code scanning / Pyre

Undefined import

Undefined import [21]: Could not find a module corresponding to import `x402.fastapi.middleware`.
X402_AVAILABLE = False


class PaymentConfig(BaseModel):

Check failure

Code scanning / Pyre

Undefined or invalid type

Undefined or invalid type [11]: Annotation `BaseModel` is not defined as a type.

if X402_AVAILABLE:

class X402PaymentMiddleware(BaseHTTPMiddleware):

Check failure

Code scanning / Pyre

Undefined or invalid type

Undefined or invalid type [11]: Annotation `BaseHTTPMiddleware` is not defined as a type.
app: Starlette app instance
payment_config: Payment configuration with wallet, price, network
"""
super().__init__(app)

Check failure

Code scanning / Pyre

Too many arguments

Too many arguments [19]: Call `object.__init__` expects 0 positional arguments, 1 was provided.
},
)

async def dispatch(self, request: Request, call_next):

Check failure

Code scanning / Pyre

Undefined or invalid type

Undefined or invalid type [11]: Annotation `Request` is not defined as a type.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant