MCPcopy Create free account
hub / github.com/MemTensor/MemOS / get_g_object

Function get_g_object

src/memos/api/context/dependencies.py:12–22  ·  view source on GitHub ↗

Get Flask g-like object for the current request. Returns the context created by middleware.

()

Source from the content-addressed store, hash-verified

10
11
12def get_g_object() -> G:
13 """
14 Get Flask g-like object for the current request.
15 Returns the context created by middleware.
16 """
17 ctx = get_current_context()
18 if ctx is None:
19 raise RuntimeError(
20 "No request context available. Make sure RequestContextMiddleware is properly configured."
21 )
22 return ctx
23
24
25def get_current_g() -> G | None:

Callers

nothing calls this directly

Calls 1

get_current_contextFunction · 0.90

Tested by

no test coverage detected