Skip to content

Commit f4026a3

Browse files
authored
Merge pull request #29 from AgentOps-AI/tool-cta
add CTA functionality
2 parents baa24f8 + 4f06c0e commit f4026a3

File tree

7 files changed

+23
-9
lines changed

7 files changed

+23
-9
lines changed

agentstack/cli/cli.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
from art import text2art
88
import inquirer
99
import os
10-
import webbrowser
1110
import importlib.resources
1211
from cookiecutter.main import cookiecutter
1312

agentstack/generation/tool_generation.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@ def add_tool(tool_name: str, path: Optional[str] = None):
3636
json.dump(agentstack_json, f, indent=4)
3737

3838
print(term_color(f'🔨 Tool {tool_name} added to agentstack project successfully', 'green'))
39+
if tool_data.get('cta'):
40+
print(term_color(f'🪩 {tool_data["cta"]}', 'blue'))
3941

4042

4143
def add_tool_to_tools_init(tool_data: dict, path: Optional[str] = None):

agentstack/tools/browserbase.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,6 @@
22
"name": "browserbase",
33
"package": "poetry add browserbase crewai-tools",
44
"env": "BROWSERBASE_API_KEY=...\nBROWSERBASE_PROJECT_ID=...",
5-
"tools": ["browserbase"]
5+
"tools": ["browserbase"],
6+
"cta": "Create an API key at https://www.browserbase.com/"
67
}

agentstack/tools/firecrawl.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,6 @@
22
"name": "firecrawl",
33
"package": "poetry add firecrawl-py",
44
"env": "FIRECRAWL_API_KEY=...",
5-
"tools": ["web_scrape", "web_crawl", "retrieve_web_crawl"]
5+
"tools": ["web_scrape", "web_crawl", "retrieve_web_crawl"],
6+
"cta": "Create an API key at https://www.firecrawl.dev/"
67
}

agentstack/tools/ftp.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,6 @@
22
"name": "ftp",
33
"package": "",
44
"env": "FTP_HOST=...\nFTP_USER=...\nFTP_PASSWORD=...",
5-
"tools": ["upload_files"]
5+
"tools": ["upload_files"],
6+
"cta": "Be sure to add your FTP credentials to .env"
67
}

agentstack/tools/mem0.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,6 @@
22
"name": "mem0",
33
"package": "poetry add mem0ai",
44
"env": "NEO4J_URL=...\nNEO4J_USERNAME=...\nNEO4J_PASSWORD=...",
5-
"tools": ["write_to_memory", "read_from_memory"]
5+
"tools": ["write_to_memory", "read_from_memory"],
6+
"cta": "Optionally: setup your graph db hosting at https://app.mem0.ai/login"
67
}

agentstack/utils.py

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -64,14 +64,23 @@ def clean_input(input_string):
6464

6565

6666
def term_color(text: str, color: str) -> str:
67-
if color is 'red':
68-
return "\033[91m{}\033[00m".format(text)
69-
if color is 'green':
70-
return "\033[92m{}\033[00m".format(text)
67+
colors = {
68+
'red': '91',
69+
'green': '92',
70+
'yellow': '93',
71+
'blue': '94',
72+
'purple': '95',
73+
'cyan': '96',
74+
'white': '97'
75+
}
76+
color_code = colors.get(color)
77+
if color_code:
78+
return f"\033[{color_code}m{text}\033[00m"
7179
else:
7280
return text
7381

7482

83+
7584
def is_snake_case(string: str):
7685
return bool(re.match('^[a-z0-9_]+$', string))
7786

0 commit comments

Comments
 (0)