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

Function set_request_context

src/memos/context/context.py:91–100  ·  view source on GitHub ↗

Set the current request context. This is typically called by the API dependency injection system.

(context: RequestContext | None)

Source from the content-addressed store, hash-verified

89
90
91def set_request_context(context: RequestContext | None) -> None:
92 """
93 Set the current request context.
94
95 This is typically called by the API dependency injection system.
96 """
97 if context:
98 _request_context.set(context.to_dict())
99 else:
100 _request_context.set(None)
101
102
103def get_current_trace_id() -> str | None:

Callers 11

wrapped_handlerMethod · 0.90
_message_consumerMethod · 0.90
dispatchMethod · 0.90
thread_taskFunction · 0.90
runMethod · 0.85
wrapperMethod · 0.85

Calls 2

setMethod · 0.65
to_dictMethod · 0.45