We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4452834 commit 8b9bfbaCopy full SHA for 8b9bfba
packages/gg_api_core/src/gg_api_core/client.py
@@ -968,7 +968,13 @@ async def get_current_token_info(self) -> dict[str, Any]:
968
969
# If we already have token info, return it
970
if self._token_info is not None:
971
- return self._token_info
+ # Convert Pydantic model to dict if needed
972
+ if hasattr(self._token_info, "model_dump"):
973
+ return self._token_info.model_dump()
974
+ elif isinstance(self._token_info, dict):
975
+ return self._token_info
976
+ else:
977
+ return await self._request("GET", "/api_tokens/self")
978
979
# Otherwise fetch from the API
980
return await self._request("GET", "/api_tokens/self")
0 commit comments