Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Swekit refactoring (working swe-agent in langgraph and crewai, pr-review-agent in langgraph) #821

Merged
merged 10 commits into from
Nov 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion python/composio/tools/local/codeanalysis/tool.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class CodeAnalysisTool(LocalTool, autoload=True):
"tree_sitter==0.21.3",
"deeplake>3.9,<4",
"sentence-transformers",
"tokenizers>=0.19,<0.20",
"tokenizers>=0.20,<0.21",
"tree_sitter_languages",
"git+https://github.com/DataDog/jedi.git@92d0c807b0dcd115b1ffd0a4ed21e44db127c2fb#egg=jedi",
"PyJWT", # deeplake/client/client.py:41
Expand Down
5 changes: 4 additions & 1 deletion python/swe/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,9 +98,12 @@ Before getting started, ensure you have the following set up:
1. Scaffold your agent using:

```
swekit scaffold crewai -o <path>
swekit scaffold <type> -f <framework> -o <path>
```

- `<type>` can be `swe` or `pr_review` depending on the use-case
- `<framework>` can be `crewai` or `langgraph`. Support for more frameworks coming soon!

This creates a new agent in `<path>/agent` with four key files:

- `main.py`: Entry point to run the agent on your issue
Expand Down
10 changes: 5 additions & 5 deletions python/swe/swekit/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ def swekit() -> None:


@swekit.command(name="scaffold")
@click.argument("framework", type=EnumParam(cls=AgenticFramework))
@click.argument("type", type=EnumParam(cls=AgentType))
@click.option(
"-n",
"--name",
Expand All @@ -31,11 +31,11 @@ def swekit() -> None:
help="Output directory for the agent",
)
@click.option(
"-t",
"--type",
type=EnumParam(cls=AgentType),
"-f",
"--framework",
type=EnumParam(cls=AgenticFramework),
help="Type of agent to scaffold, defaults to SWE",
default=AgentType.SWE,
default=AgenticFramework.LANGGRAPH,
)
@click.help_option("--help")
def _scaffold(
Expand Down
3 changes: 1 addition & 2 deletions python/swe/swekit/scaffold/_scaffold.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,13 @@ class AgenticFramework(Enum):
LANGGRAPH = "langgraph"
CAMELAI = "camelai"
AUTOGEN = "autogen"
SWEAGENT = "swe-agent"

def load_templates(self, agent_type: AgentType) -> t.Dict:
"""Load template string."""
if agent_type == AgentType.SWE:
return {
file.name.replace(".template", ".py"): file.read_text(encoding="utf-8")
for file in (TEMPLATES_PATH / self.value).glob("*.template")
for file in (TEMPLATES_PATH / "swe" / self.value).glob("*.template")
}
elif agent_type == AgentType.PR_REVIEW:
return {
Expand Down
63 changes: 0 additions & 63 deletions python/swe/swekit/scaffold/templates/crewai/agent.template

This file was deleted.

This file was deleted.

This file was deleted.

156 changes: 0 additions & 156 deletions python/swe/swekit/scaffold/templates/langgraph/agent.template

This file was deleted.

This file was deleted.

Loading
Loading