Spaces:
Running
Running
Refactor get_profile function to accept user_id directly, removing the Pydantic model dependency.
Browse files
app.py
CHANGED
|
@@ -215,14 +215,10 @@ def numpy_multi_dot(input: NumpyMultiDotInput) -> List[List[float]]:
|
|
| 215 |
def get_version():
|
| 216 |
return "2.0.1"
|
| 217 |
|
| 218 |
-
# Dynamic resource template
|
| 219 |
-
class GetProfileInput(BaseModel):
|
| 220 |
-
user_id: int
|
| 221 |
-
|
| 222 |
@mcp.resource("users://{user_id}/profile")
|
| 223 |
-
def get_profile(
|
| 224 |
# Fetch profile for user_id...
|
| 225 |
-
return {"name": f"User {
|
| 226 |
|
| 227 |
class SummarizeRequestInput(BaseModel):
|
| 228 |
text: str
|
|
|
|
| 215 |
def get_version():
|
| 216 |
return "2.0.1"
|
| 217 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 218 |
@mcp.resource("users://{user_id}/profile")
|
| 219 |
+
def get_profile(user_id: int):
|
| 220 |
# Fetch profile for user_id...
|
| 221 |
+
return {"name": f"User {user_id}", "status": "active"}
|
| 222 |
|
| 223 |
class SummarizeRequestInput(BaseModel):
|
| 224 |
text: str
|