Skip to content

Commit

Permalink
Crew support (#143)
Browse files Browse the repository at this point in the history
* pydantic support

* allow client naming outside decorator

* expose record at top level

* merge

* remove main logs

* remove main logs

* track agent in event recording

* use drilldown route for session view

* optional dependency support

* set parent key

* version number
  • Loading branch information
bboynton97 authored Apr 4, 2024
1 parent cdcce4a commit 6356648
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 2 deletions.
8 changes: 8 additions & 0 deletions agentops/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,3 +69,11 @@ def add_tags(tags: List[str]):

def set_tags(tags: List[str]):
Client().set_tags(tags)


def get_api_key() -> str:
return Client().api_key


def set_parent_key(parent_key):
Client().set_parent_key(parent_key)
15 changes: 14 additions & 1 deletion agentops/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,8 @@ def end_session(self,
self._worker = None

def create_agent(self, agent_id: str, name: str):
self._worker.create_agent(agent_id, name)
if self._worker:
self._worker.create_agent(agent_id, name)

def _handle_unclean_exits(self):
def cleanup(end_state: Optional[str] = 'Fail', end_state_reason: Optional[str] = None):
Expand Down Expand Up @@ -293,3 +294,15 @@ def handle_exception(exc_type, exc_value, exc_traceback):
@property
def current_session_id(self):
return self._session.session_id

@property
def api_key(self):
return self.config.api_key

def set_parent_key(self, parent_key):
if self._worker:
self._worker.config.parent_key = parent_key

@property
def parent_key(self):
return self.config.parent_key
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"

[project]
name = "agentops"
version = "0.1.0"
version = "0.1.1"
authors = [
{ name="Alex Reibman", email="[email protected]" },
{ name="Shawn Qiu", email="[email protected]" },
Expand Down

0 comments on commit 6356648

Please sign in to comment.