Skip to content

Conversation

@bmacer
Copy link
Contributor

@bmacer bmacer commented Dec 11, 2024

📥 Pull Request

📘 Description
Addresses #90

  • Accept a local .json file as a template
  • Accept a remote https file as a template
  • Check for existence of these files, with decent error messages
  • Improve error messaging when using built-in template

🧪 Testing

Remote file doesn't exist:

agentstack init --template=https://raw.githubusercontent.com/AgentOps-AI/AgentStack/refs/heads/main/agentstack/templates/proj_templates/research2.json
Failed to fetch template data from https://raw.githubusercontent.com/AgentOps-AI/AgentStack/refs/heads/main/agentstack/templates/proj_templates/research2.json

Local file doesn't exist:

agentstack init --template=local-template-file-doesnt-exist.json
Template file does not exist: /Users/bmacer/Desktop/home/agentstack/newAgentStack/AgentStack/local-template-file-doesnt-exist.json

Remote file does exist:

agentstack init --template=https://raw.githubusercontent.com/AgentOps-AI/AgentStack/refs/heads/main/agentstack/templates/proj_templates/research.json

🚀 AgentStack project generated successfully!

  Next, run:
    cd research
    python -m venv .venv
    source .venv/bin/activate
    poetry install

  Add agents and tasks with:
    `agentstack generate agent/task <name>`

  Run your agent with:
    agentstack run

  Run `agentstack quickstart` or `agentstack docs` for next steps.

🔨 Tool perplexity added to agentstack project successfully

Local file does exist:

agentstack init --template=system_analyzer.json

🚀 AgentStack project generated successfully!

  Next, run:
    cd system_analyzer
    python -m venv .venv
    source .venv/bin/activate
    poetry install

  Add agents and tasks with:
    `agentstack generate agent/task <name>`

  Run your agent with:
    agentstack run

  Run `agentstack quickstart` or `agentstack docs` for next steps.

🔨 Tool directory_search added to agentstack project successfully
🔨 Tool file_read added to agentstack project successfully
🔨 Tool code_interpreter added to agentstack project successfully

Built-in template does exist:

python -m agentstack.main init --template=content_creator

🚀 AgentStack project generated successfully!

  Next, run:
    cd content_creator
    python -m venv .venv
    source .venv/bin/activate
    poetry install

  Add agents and tasks with:
    `agentstack generate agent/task <name>`

  Run your agent with:
    agentstack run

  Run `agentstack quickstart` or `agentstack docs` for next steps.

🔨 Tool perplexity added to agentstack project successfully

Built-in template doesn't exist:

agentstack init --template=template-doesnt-exist
No known built-in template: template-doesnt-exist
Available built-in templates:
content_creator
research
system_analyzer

@bboynton97
Copy link
Contributor

hi @bmacer! thank you very much for the contribution! if you look at line 64 of agentstack/cli.py, you'll see we're already calling the proper json loading function based on if the template name contains http. we also check again at line 115 of proj_templates.py.

this is duplication of work, so i'm going to close this PR, but we would love to see future contributions from you and appreciate the work!! :)

@bboynton97 bboynton97 closed this Dec 30, 2024
@bboynton97
Copy link
Contributor

hey @bmacer! my apologies, i think i completely misinterpreted this PR! after i realized this addresses #90, it all made so much more sense. im merging now! thank you for the contribution, and dont forget to fill out this form if you want a contributor sticker pack :)

@bboynton97 bboynton97 reopened this Jan 2, 2025
@bboynton97 bboynton97 merged commit 8ed1e96 into agentstack-ai:main Jan 2, 2025
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants