Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions agentstack/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,20 @@
"""
from pathlib import Path
from agentstack import conf
from agentstack.utils import get_framework
from agentstack.inputs import get_inputs

___all___ = [
"conf",
"get_tags",
"get_framework",
"get_inputs",
]


def get_tags() -> list[str]:
"""
Get a list of tags relevant to the user's project.
"""
return ['agentstack', get_framework(), *conf.get_installed_tools()]

13 changes: 11 additions & 2 deletions agentstack/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,21 @@ def get_framework() -> Optional[str]:
and if we are inside a project directory.
"""
try:
config = ConfigFile()
return config.framework
return ConfigFile().framework
except FileNotFoundError:
return None # not in a project directory; that's okay


def get_installed_tools() -> list[str]:
"""The tools used in the project. Will be available after PATH has been set
and if we are inside a project directory.
"""
try:
return ConfigFile().tools
except FileNotFoundError:
return []


class ConfigFile(BaseModel):
"""
Interface for interacting with the agentstack.json file inside a project directory.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import agentstack
import agentops

agentops.init(default_tags=['crewai', 'agentstack'])
agentops.init(default_tags=agentstack.get_tags())

instance = {{cookiecutter.project_metadata.project_name|replace('-', '')|replace('_', '')|capitalize}}Crew().crew()

Expand Down
Loading