style: Fix imports and line length formatting
This commit is contained in:
parent
7bbf71e29a
commit
a79f51f55f
7 changed files with 232 additions and 125 deletions
|
|
@ -4,8 +4,10 @@ FastMCP Complex inputs Example
|
|||
Demonstrates validation via pydantic with complex models.
|
||||
"""
|
||||
|
||||
from pydantic import BaseModel, Field
|
||||
from typing import Annotated
|
||||
|
||||
from pydantic import BaseModel, Field
|
||||
|
||||
from mcp.server.fastmcp import FastMCP
|
||||
|
||||
mcp = FastMCP("Shrimp Tank")
|
||||
|
|
|
|||
|
|
@ -6,7 +6,8 @@
|
|||
|
||||
"""
|
||||
Recursive memory system inspired by the human brain's clustering of memories.
|
||||
Uses OpenAI's 'text-embedding-3-small' model and pgvector for efficient similarity search.
|
||||
Uses OpenAI's 'text-embedding-3-small' model and pgvector for efficient
|
||||
similarity search.
|
||||
"""
|
||||
|
||||
import asyncio
|
||||
|
|
@ -111,7 +112,8 @@ class MemoryNode(BaseModel):
|
|||
if self.id is None:
|
||||
result = await conn.fetchrow(
|
||||
"""
|
||||
INSERT INTO memories (content, summary, importance, access_count, timestamp, embedding)
|
||||
INSERT INTO memories (content, summary, importance, access_count,
|
||||
timestamp, embedding)
|
||||
VALUES ($1, $2, $3, $4, $5, $6)
|
||||
RETURNING id
|
||||
""",
|
||||
|
|
@ -336,7 +338,8 @@ async def initialize_database():
|
|||
timestamp DOUBLE PRECISION NOT NULL,
|
||||
embedding vector(1536) NOT NULL
|
||||
);
|
||||
CREATE INDEX IF NOT EXISTS idx_memories_embedding ON memories USING hnsw (embedding vector_l2_ops);
|
||||
CREATE INDEX IF NOT EXISTS idx_memories_embedding ON memories
|
||||
USING hnsw (embedding vector_l2_ops);
|
||||
""")
|
||||
finally:
|
||||
await pool.close()
|
||||
|
|
|
|||
|
|
@ -1,6 +1,5 @@
|
|||
from mcp.server.fastmcp import FastMCP
|
||||
|
||||
|
||||
# Create an MCP server
|
||||
mcp = FastMCP("Demo")
|
||||
|
||||
|
|
|
|||
|
|
@ -5,10 +5,10 @@ Give Claude a tool to capture and view screenshots.
|
|||
"""
|
||||
|
||||
import io
|
||||
|
||||
from mcp.server.fastmcp import FastMCP
|
||||
from mcp.server.fastmcp.utilities.types import Image
|
||||
|
||||
|
||||
# Create server
|
||||
mcp = FastMCP("Screenshot Demo", dependencies=["pyautogui", "Pillow"])
|
||||
|
||||
|
|
|
|||
|
|
@ -4,7 +4,6 @@ FastMCP Echo Server
|
|||
|
||||
from mcp.server.fastmcp import FastMCP
|
||||
|
||||
|
||||
# Create server
|
||||
mcp = FastMCP("Echo Server")
|
||||
|
||||
|
|
|
|||
|
|
@ -19,6 +19,7 @@ Visit https://surgemsg.com/ and click "Get Started" to obtain these values.
|
|||
"""
|
||||
|
||||
from typing import Annotated
|
||||
|
||||
import httpx
|
||||
from pydantic import BeforeValidator
|
||||
from pydantic_settings import BaseSettings, SettingsConfigDict
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
import anyio
|
||||
import click
|
||||
import mcp.types as types
|
||||
from pydantic import AnyUrl
|
||||
from mcp.server.lowlevel import Server
|
||||
from pydantic import AnyUrl
|
||||
|
||||
SAMPLE_RESOURCES = {
|
||||
"greeting": "Hello! This is a sample text resource.",
|
||||
|
|
|
|||
Loading…
Reference in a new issue