Skip to content

Commit 1bb716f

Browse files
committed
Merge branch 'main' into tool-suggestions
2 parents cd3060a + 40c72f7 commit 1bb716f

File tree

4 files changed

+58
-1
lines changed

4 files changed

+58
-1
lines changed

TODO.md

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
## Wizard
2+
3+
4+
## LangGraph
5+
6+
[ ] Bug: empty `bind_tools` list on a new Agent throws an error
7+
8+
[ ] Reliably handle adding two Tasks and two Agent via CLI
9+
10+
[ ] Create a new template demonstrating graph usage
11+
12+
13+
"Top of Funnel"
14+
15+
[] Hello World!
16+
17+
[] Catch common exception types from the user's first `agentstack run` and provide a helpful error message.
18+
- In order to avoid importing all the sub-libraries, use string matching to determine what the exception is.
19+
20+
[] Allow the user to select from a list of tools if a <tool_name> is not provided to `agenstack add tools`
21+
22+
[ ] Handle all setup tasks that `agentstack init` needs.
23+
- Wrap the output in a `curses` window to show progress.
24+
- Prevent the user from having to scroll back up to find the help text from the `init` command.
25+
- Use `uv` for all package management.
26+
27+
[] Modify agentops init to indicate which tools are being used.
28+
- Possibly with an `agentstack.get_tags()` method that automatically sets relevant tags.
29+
30+
[] If there is only one agent in the project, treat it as a default.
31+
- New tasks should be assigned to it.
32+
33+
[] Wrap tools in the framework's protocol before including them in the project.
34+
- Access tools with `agentstack.tools['tool_name']` which dynamically generates the wrapped tool.
35+
- This will be a breaking change with the 0.3 release.

agentstack/cli/init.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,10 @@ def init_project(
124124

125125
if framework is None:
126126
framework = template_data.framework
127+
128+
if framework in frameworks.ALIASED_FRAMEWORKS:
129+
framework = frameworks.ALIASED_FRAMEWORKS[framework]
130+
127131
if not framework in frameworks.SUPPORTED_FRAMEWORKS:
128132
raise Exception(f"Framework '{framework}' is not supported.")
129133
log.info(f"Using framework: {framework}")

agentstack/frameworks/__init__.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,9 @@
2727
OPENAI_SWARM,
2828
LLAMAINDEX,
2929
]
30+
ALIASED_FRAMEWORKS = {
31+
'crew': CREWAI,
32+
}
3033
DEFAULT_FRAMEWORK = CREWAI
3134

3235

tests/test_cli_init.py

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,14 @@
44
from pathlib import Path
55
import shutil
66
from cli_test_utils import run_cli
7+
from agentstack import conf
8+
from agentstack import frameworks
9+
from agentstack.cli import init_project
710
from agentstack.templates import get_all_templates
811

912
BASE_PATH = Path(__file__).parent
1013

14+
1115
class CLIInitTest(unittest.TestCase):
1216
def setUp(self):
1317
self.framework = os.getenv('TEST_FRAMEWORK')
@@ -21,9 +25,20 @@ def setUp(self):
2125
def tearDown(self):
2226
shutil.rmtree(self.project_dir, ignore_errors=True)
2327

24-
@parameterized.expand([(template.name, ) for template in get_all_templates()])
28+
@parameterized.expand([(template.name,) for template in get_all_templates()])
2529
def test_init_command(self, template_name: str):
2630
"""Test the 'init' command to create a project directory."""
2731
result = run_cli('init', 'test_project', '--template', template_name)
2832
self.assertEqual(result.returncode, 0)
2933
self.assertTrue((self.project_dir / 'test_project').exists())
34+
35+
@parameterized.expand([(k, v) for k, v in frameworks.ALIASED_FRAMEWORKS.items()])
36+
def test_init_command_aliased_framework_empty_project(self, alias: str, framework: str):
37+
"""Test the 'init' command with an aliased framework."""
38+
if framework != self.framework:
39+
self.skipTest(f"{alias} is not related to this framework")
40+
41+
init_project(slug_name='test_project', template='empty', framework=alias)
42+
conf.set_path(self.project_dir / 'test_project')
43+
config = conf.ConfigFile()
44+
assert config.framework == framework

0 commit comments

Comments
 (0)