Skip to content
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
78 changes: 77 additions & 1 deletion codegen-examples/examples/swebench_agent_run/local_run.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,82 @@
"source": [
"await run_eval(use_existing_preds=None, dataset=\"lite\", length=20, repo=\"django/django\", num_workers=10, model=\"claude-3-7-sonnet-latest\")"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"from codegen.sdk.core.codebase import Codebase # noqa: E402\n",
"\n",
"codebase = Codebase.from_repo(repo_full_name=\"codegen-sh/cloud\")"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"# prompt = \"\"\"\n",
"# Please write integration tests for github tools. Below are paths to relevant files:\n",
"# Existing integration tests for linear (use these as an example):\n",
"# - codegen-backend/codegen_integration/test_linear_tools.py\n",
"# Github Langchain Interface:\n",
"# - codegen-backend/app/modal_app/gen/github_utils/tools.py\n",
"# Directory Containing github tools:\n",
"# - codegen-backend/app/modal_app/gen/tools/github\n",
"# \"\"\"\n",
"prompt = \"\"\"\n",
"Add a notion integration to the codebase. View similar integrations for linear.\n",
"Please view the existing integrations for linear.\n",
"- src/codegen/extensions/clients/linear.py\n",
"\"\"\""
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"from codegen.agents.code_agent import CodeAgent\n",
"\n",
"agent = CodeAgent(codebase=codebase, tags=[\"local_test\"], model_name=\"claude-3-5-sonnet-latest\", model_provider=\"anthropic\")"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"agent.run(prompt)"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"codebase.reset()"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
Expand All @@ -52,7 +128,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.13.0"
"version": "3.13.1"
}
},
"nbformat": 4,
Expand Down
2 changes: 1 addition & 1 deletion src/codegen/extensions/langchain/agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ def create_codebase_agent(
Returns:
Initialized agent with message history
"""
llm = LLM(model_provider=model_provider, model_name=model_name, **kwargs)
llm = LLM(model_provider=model_provider, model_name=model_name, max_tokens=8192, **kwargs)

# Get all codebase tools
tools = [
Expand Down
Loading