We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 66f2fba commit 34c53f9Copy full SHA for 34c53f9
1 file changed
examples/fastmcp/memory.py
@@ -16,7 +16,7 @@
16
from dataclasses import dataclass
17
from datetime import datetime, timezone
18
from pathlib import Path
19
-from typing import Annotated, Self
+from typing import Annotated, Self, TypeVar
20
21
import asyncpg
22
import numpy as np
@@ -35,6 +35,8 @@
35
DEFAULT_LLM_MODEL = "openai:gpt-4o"
36
DEFAULT_EMBEDDING_MODEL = "text-embedding-3-small"
37
38
+T = TypeVar("T")
39
+
40
mcp = FastMCP(
41
"memory",
42
dependencies=[
@@ -57,7 +59,7 @@ def cosine_similarity(a: list[float], b: list[float]) -> float:
57
59
return np.dot(a_array, b_array) / (np.linalg.norm(a_array) * np.linalg.norm(b_array))
58
60
61
-async def do_ai[T](
62
+async def do_ai(
63
user_prompt: str,
64
system_prompt: str,
65
result_type: type[T] | Annotated,
0 commit comments