Skip to content

Commit 34c53f9

Browse files
committed
Use TypeVar instead of new notation
1 parent 66f2fba commit 34c53f9

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

examples/fastmcp/memory.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
from dataclasses import dataclass
1717
from datetime import datetime, timezone
1818
from pathlib import Path
19-
from typing import Annotated, Self
19+
from typing import Annotated, Self, TypeVar
2020

2121
import asyncpg
2222
import numpy as np
@@ -35,6 +35,8 @@
3535
DEFAULT_LLM_MODEL = "openai:gpt-4o"
3636
DEFAULT_EMBEDDING_MODEL = "text-embedding-3-small"
3737

38+
T = TypeVar("T")
39+
3840
mcp = FastMCP(
3941
"memory",
4042
dependencies=[
@@ -57,7 +59,7 @@ def cosine_similarity(a: list[float], b: list[float]) -> float:
5759
return np.dot(a_array, b_array) / (np.linalg.norm(a_array) * np.linalg.norm(b_array))
5860

5961

60-
async def do_ai[T](
62+
async def do_ai(
6163
user_prompt: str,
6264
system_prompt: str,
6365
result_type: type[T] | Annotated,

0 commit comments

Comments
 (0)