Skip to content

Commit 653f3e7

Browse files
committed
Add project premium status check in V3Client authentication response
1 parent f358194 commit 653f3e7

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

  • agentops/client/api/versions

agentops/client/api/versions/v3.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
from agentops.client.api.types import AuthTokenResponse
99
from agentops.exceptions import ApiServerException
1010
from agentops.logging import logger
11+
from termcolor import colored
1112

1213

1314
class V3Client(BaseApiClient):
@@ -47,6 +48,15 @@ def fetch_auth_token(self, api_key: str) -> AuthTokenResponse:
4748
if not token:
4849
raise ApiServerException("No token in authentication response")
4950

51+
# Check project premium status
52+
if jr.get("project_prem_status") != "pro":
53+
logger.info(
54+
colored(
55+
"\x1b[34mYou're on the agentops free plan 📎 - Upgrade at https://app.agentops.ai/settings/billing\x1b[0m",
56+
"blue",
57+
)
58+
)
59+
5060
return jr
5161
except Exception as e:
5262
logger.error(f"Failed to process authentication response: {str(e)}")

0 commit comments

Comments
 (0)