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 6
6
"""
7
7
from pathlib import Path
8
8
from agentstack import conf
9
+ from agentstack .utils import get_framework
9
10
from agentstack .inputs import get_inputs
10
11
11
12
___all___ = [
12
13
"conf" ,
14
+ "get_tags" ,
15
+ "get_framework" ,
13
16
"get_inputs" ,
14
17
]
15
18
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]:
23
23
and if we are inside a project directory.
24
24
"""
25
25
try :
26
- config = ConfigFile ()
27
- return config .framework
26
+ return ConfigFile ().framework
28
27
except FileNotFoundError :
29
28
return None # not in a project directory; that's okay
30
29
31
30
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
+
32
41
class ConfigFile (BaseModel ):
33
42
"""
34
43
Interface for interacting with the agentstack.json file inside a project directory.
Original file line number Diff line number Diff line change 4
4
import agentstack
5
5
import agentops
6
6
7
- agentops .init (default_tags = [ 'crewai' , ' agentstack' ] )
7
+ agentops .init (default_tags = agentstack . get_tags () )
8
8
9
9
instance = {{cookiecutter .project_metadata .project_name | replace ('-' , '' )| replace ('_' , '' )| capitalize }}Crew ().crew ()
10
10
You can’t perform that action at this time.
0 commit comments