Skip to content

Commit 8b9bfba

Browse files
committed
fix
1 parent 4452834 commit 8b9bfba

File tree

1 file changed

+7
-1
lines changed
  • packages/gg_api_core/src/gg_api_core

1 file changed

+7
-1
lines changed

packages/gg_api_core/src/gg_api_core/client.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -968,7 +968,13 @@ async def get_current_token_info(self) -> dict[str, Any]:
968968

969969
# If we already have token info, return it
970970
if self._token_info is not None:
971-
return self._token_info
971+
# 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")
972978

973979
# Otherwise fetch from the API
974980
return await self._request("GET", "/api_tokens/self")

0 commit comments

Comments
 (0)