Skip to content

Commit

Permalink
Parent key (#121)
Browse files Browse the repository at this point in the history
* parent key support

* optional logic clarification

* environ check once

* assign env key

* assign env key
  • Loading branch information
bboynton97 authored Mar 27, 2024
1 parent 0991dc1 commit bef9f92
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions agentops/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,10 @@ def __init__(self, api_key: Optional[str] = None,

# These handle the case where .init() is used with optionals, and one of these
# params are None, which is does not trigger the Optional default in the constructor
if not api_key and not environ.get('AGENTOPS_API_KEY'):
logging.warning("AgentOps: No API key provided - no data will be recorded.")
if not api_key:
api_key = environ.get("AGENTOPS_API_KEY")
if not api_key:
logging.warning("AgentOps: No API key provided - no data will be recorded.")
return

if not parent_key:
Expand Down

0 comments on commit bef9f92

Please sign in to comment.