Skip to content

Commit 0157b78

Browse files
fix: increased max token limit (#817)
# Motivation <!-- Why is this change necessary? --> # Content <!-- Please include a summary of the change --> # Testing <!-- How was the change tested? --> # Please check the following before marking your PR as ready for review - [ ] I have added tests for my changes - [ ] I have updated the documentation or added new documentation as needed
1 parent b7e533d commit 0157b78

File tree

2 files changed

+78
-2
lines changed

2 files changed

+78
-2
lines changed

codegen-examples/examples/swebench_agent_run/local_run.ipynb

Lines changed: 77 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,82 @@
3434
"source": [
3535
"await run_eval(use_existing_preds=None, dataset=\"lite\", length=20, repo=\"django/django\", num_workers=10, model=\"claude-3-7-sonnet-latest\")"
3636
]
37+
},
38+
{
39+
"cell_type": "code",
40+
"execution_count": null,
41+
"metadata": {},
42+
"outputs": [],
43+
"source": [
44+
"from codegen.sdk.core.codebase import Codebase # noqa: E402\n",
45+
"\n",
46+
"codebase = Codebase.from_repo(repo_full_name=\"codegen-sh/cloud\")"
47+
]
48+
},
49+
{
50+
"cell_type": "code",
51+
"execution_count": null,
52+
"metadata": {},
53+
"outputs": [],
54+
"source": [
55+
"# prompt = \"\"\"\n",
56+
"# Please write integration tests for github tools. Below are paths to relevant files:\n",
57+
"# Existing integration tests for linear (use these as an example):\n",
58+
"# - codegen-backend/codegen_integration/test_linear_tools.py\n",
59+
"# Github Langchain Interface:\n",
60+
"# - codegen-backend/app/modal_app/gen/github_utils/tools.py\n",
61+
"# Directory Containing github tools:\n",
62+
"# - codegen-backend/app/modal_app/gen/tools/github\n",
63+
"# \"\"\"\n",
64+
"prompt = \"\"\"\n",
65+
"Add a notion integration to the codebase. View similar integrations for linear.\n",
66+
"Please view the existing integrations for linear.\n",
67+
"- src/codegen/extensions/clients/linear.py\n",
68+
"\"\"\""
69+
]
70+
},
71+
{
72+
"cell_type": "code",
73+
"execution_count": null,
74+
"metadata": {},
75+
"outputs": [],
76+
"source": [
77+
"from codegen.agents.code_agent import CodeAgent\n",
78+
"\n",
79+
"agent = CodeAgent(codebase=codebase, tags=[\"local_test\"], model_name=\"claude-3-5-sonnet-latest\", model_provider=\"anthropic\")"
80+
]
81+
},
82+
{
83+
"cell_type": "code",
84+
"execution_count": null,
85+
"metadata": {},
86+
"outputs": [],
87+
"source": [
88+
"agent.run(prompt)"
89+
]
90+
},
91+
{
92+
"cell_type": "code",
93+
"execution_count": null,
94+
"metadata": {},
95+
"outputs": [],
96+
"source": [
97+
"codebase.reset()"
98+
]
99+
},
100+
{
101+
"cell_type": "code",
102+
"execution_count": null,
103+
"metadata": {},
104+
"outputs": [],
105+
"source": []
106+
},
107+
{
108+
"cell_type": "code",
109+
"execution_count": null,
110+
"metadata": {},
111+
"outputs": [],
112+
"source": []
37113
}
38114
],
39115
"metadata": {
@@ -52,7 +128,7 @@
52128
"name": "python",
53129
"nbconvert_exporter": "python",
54130
"pygments_lexer": "ipython3",
55-
"version": "3.13.0"
131+
"version": "3.13.1"
56132
}
57133
},
58134
"nbformat": 4,

src/codegen/extensions/langchain/agent.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ def create_codebase_agent(
5757
Returns:
5858
Initialized agent with message history
5959
"""
60-
llm = LLM(model_provider=model_provider, model_name=model_name, **kwargs)
60+
llm = LLM(model_provider=model_provider, model_name=model_name, max_tokens=8192, **kwargs)
6161

6262
# Get all codebase tools
6363
tools = [

0 commit comments

Comments
 (0)