File tree Expand file tree Collapse file tree 3 files changed +22
-3
lines changed
templates/crewai/{{cookiecutter.project_metadata.project_slug}}/src Expand file tree Collapse file tree 3 files changed +22
-3
lines changed Original file line number Diff line number Diff line change 66"""
77from pathlib import Path
88from agentstack import conf
9+ from agentstack .utils import get_framework
910from agentstack .inputs import get_inputs
1011
1112___all___ = [
1213 "conf" ,
14+ "get_tags" ,
15+ "get_framework" ,
1316 "get_inputs" ,
1417]
1518
19+
20+ def get_tags () -> list [str ]:
21+ """
22+ Get a list of tags relevant to the user's project.
23+ """
24+ return ['agentstack' , get_framework (), * conf .get_installed_tools ()]
25+
Original file line number Diff line number Diff line change @@ -23,12 +23,21 @@ def get_framework() -> Optional[str]:
2323 and if we are inside a project directory.
2424 """
2525 try :
26- config = ConfigFile ()
27- return config .framework
26+ return ConfigFile ().framework
2827 except FileNotFoundError :
2928 return None # not in a project directory; that's okay
3029
3130
31+ def get_installed_tools () -> list [str ]:
32+ """The tools used in the project. Will be available after PATH has been set
33+ and if we are inside a project directory.
34+ """
35+ try :
36+ return ConfigFile ().tools
37+ except FileNotFoundError :
38+ return []
39+
40+
3241class ConfigFile (BaseModel ):
3342 """
3443 Interface for interacting with the agentstack.json file inside a project directory.
Original file line number Diff line number Diff line change 44import agentstack
55import agentops
66
7- agentops .init (default_tags = [ 'crewai' , ' agentstack' ] )
7+ agentops .init (default_tags = agentstack . get_tags () )
88
99instance = {{cookiecutter .project_metadata .project_name | replace ('-' , '' )| replace ('_' , '' )| capitalize }}Crew ().crew ()
1010
You can’t perform that action at this time.
0 commit comments