MCPcopy
hub / github.com/reflex-dev/reflex / token_path

Method token_path

reflex/istate/manager/disk.py:101–112  ·  view source on GitHub ↗

Get the path for a token. Args: token: The token to get the path for. Returns: The path for the token.

(self, token: StateToken)

Source from the content-addressed store, hash-verified

99 path.unlink()
100
101 def token_path(self, token: StateToken) -> Path:
102 """Get the path for a token.
103
104 Args:
105 token: The token to get the path for.
106
107 Returns:
108 The path for the token.
109 """
110 return (
111 self.states_directory / f"{md5(str(token).encode()).hexdigest()}.pkl"
112 ).absolute()
113
114 async def load_state(self, token: StateToken[TOKEN_TYPE]) -> TOKEN_TYPE | None:
115 """Load a state object based on the provided token.

Callers 2

load_stateMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected