MCPcopy
hub / github.com/openai/openai-python / get_token

Function get_token

src/openai/auth/_workload.py:56–64  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

54 """
55
56 def get_token() -> str:
57 try:
58 with open(token_file_path, "r") as f:
59 token = f.read().strip()
60 if not token:
61 raise SubjectTokenProviderError(f"The token file at {token_file_path} is empty.")
62 return token
63 except Exception as e:
64 raise SubjectTokenProviderError(f"Failed to read the token file at {token_file_path}: {e}") from e
65
66 return {"token_type": "jwt", "get_token": get_token}
67

Callers

nothing calls this directly

Calls 4

readMethod · 0.45
getMethod · 0.45
jsonMethod · 0.45

Tested by

no test coverage detected