MCPcopy Index your code
hub / github.com/CopilotKit/CopilotKit / body_get_or_raise

Function body_get_or_raise

sdk-python/copilotkit/integrations/fastapi.py:69–74  ·  view source on GitHub ↗

Get value from body or raise an error

(body: Any, key: str)

Source from the content-addressed store, hash-verified

67
68
69def body_get_or_raise(body: Any, key: str):
70 """Get value from body or raise an error"""
71 value = body.get(key)
72 if value is None:
73 raise HTTPException(status_code=400, detail=f"{key} is required")
74 return value
75
76
77async def handler(request: Request, sdk: CopilotKitRemoteEndpoint):

Callers 2

handlerFunction · 0.85
handler_v1Function · 0.85

Calls 1

getMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…