Skip to content

Commit

Permalink
still get sdk and os
Browse files Browse the repository at this point in the history
  • Loading branch information
bboynton97 committed Apr 30, 2024
1 parent 4c1623c commit b2101b7
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 9 deletions.
2 changes: 1 addition & 1 deletion agentops/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ def start_session(self, tags: Optional[List[str]] = None, config: Optional[Confi
if not config and not self.config:
return logger.warning("🖇 AgentOps: Cannot start session - missing configuration")

self._session = Session(inherited_session_id or uuid4(), tags or self._tags, host_env=(get_host_env() if self._env_data_opt_out else None))
self._session = Session(inherited_session_id or uuid4(), tags or self._tags, host_env=get_host_env(self._env_data_opt_out))
self._worker = Worker(config or self.config)
start_session_result = self._worker.start_session(self._session)
if not start_session_result:
Expand Down
22 changes: 14 additions & 8 deletions agentops/host_env.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,17 @@ def get_disk_details():
return disk_info


def get_host_env():
return {
"SDK": get_sdk_details(),
"OS": get_os_details(),
"CPU": get_cpu_details(),
"RAM": get_ram_details(),
"Disk": get_disk_details(),
}
def get_host_env(opt_out: bool = False):
if opt_out:
return {
"SDK": get_sdk_details(),
"OS": get_os_details()
}
else:
return {
"SDK": get_sdk_details(),
"OS": get_os_details(),
"CPU": get_cpu_details(),
"RAM": get_ram_details(),
"Disk": get_disk_details(),
}

0 comments on commit b2101b7

Please sign in to comment.