matsuap commited on
Commit
3d32f20
·
1 Parent(s): 1b61f97

Refactor get_profile function to accept user_id directly, removing the Pydantic model dependency.

Browse files
Files changed (1) hide show
  1. app.py +2 -6
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(input: GetProfileInput):
224
  # Fetch profile for user_id...
225
- return {"name": f"User {input.user_id}", "status": "active"}
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