Skip to content

Commit 27fd033

Browse files
update
1 parent 27ba852 commit 27fd033

File tree

3 files changed

+36
-19
lines changed

3 files changed

+36
-19
lines changed

README.md

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,6 @@ https://github.com/user-attachments/assets/51cf6ad1-196c-44ab-99ba-0035365f1bbd
2626
* Auto-formats the code with `autopep8`
2727
* Shows the token count used for the responses
2828

29-
## Community
30-
* Join our community - [Nemo Agent Telegram Group](https://t.me/+f-6nu2mUpgtiOGUx)
31-
3229
## Coding Ability
3330
* `leetcode` hards
3431
* `fastapi` or `flask` APIs
@@ -110,6 +107,15 @@ https://github.com/user-attachments/assets/51cf6ad1-196c-44ab-99ba-0035365f1bbd
110107
* `source .venv/bin/activate`
111108
* `python main.py`
112109

110+
### Tests
111+
112+
Tests are automatically created and run.
113+
114+
### Skipping Tests
115+
116+
You many want to skip tests especially if you are generating a UI application.
117+
118+
* `nemo-agent "create a fizzbuzz script" --tests False`
113119

114120
## Models
115121

@@ -122,16 +128,18 @@ https://github.com/user-attachments/assets/51cf6ad1-196c-44ab-99ba-0035365f1bbd
122128
### Select Models
123129
* `nemo-agent "my_prompt" --provider openai --model o3-mini`
124130

125-
### Ollama Supported Models
131+
### Supported Models
132+
133+
#### Ollama
126134
* Supports any 128k input token models
127135

128-
### OpenAI Supported Models
136+
#### OpenAI
129137
* Supports `o3-mini`, `o1-mini`, `o1-preview`, `o1`, `gpt-4o`, and `gpt-4o-mini`
130138

131-
### Claude Supported Models
139+
#### Claude
132140
* Supports `claude-3-5-sonnet-20241022`
133141

134-
### Gemini Supported Models
142+
#### Gemini
135143
* Supports `gemini-2.0-flash`, `gemini-1.5-pro`, `gemini-1.5-flash`
136144

137145
## Contributing

nemo_agent/main.py

Lines changed: 20 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -302,7 +302,7 @@ class NemoAgent:
302302
WRITE_RETRY_DELAY = 1 # second
303303

304304
def __init__(
305-
self, task: str, model: str = "qwen2.5-coder:14b", provider: str = "ollama"
305+
self, task: str, model: str = "qwen2.5-coder:14b", provider: str = "ollama", tests: bool = True
306306
):
307307
self.task = task
308308
self.model = model
@@ -317,6 +317,7 @@ def __init__(
317317
self.code_content = ""
318318
self.data_content = ""
319319
self.previous_prompt = ""
320+
self.tests = tests
320321

321322
def count_tokens(self, text):
322323
encoding = tiktoken.encoding_for_model("gpt-3.5-turbo")
@@ -419,15 +420,16 @@ def run_task(self):
419420
break
420421
code_check_attempts += 1
421422

422-
test_check_attempts = 1
423-
while test_check_attempts < self.MAX_IMPROVEMENT_ATTEMPTS:
424-
tests_passed, coverage, test_output = self.run_tests()
425-
if not tests_passed or coverage < 80:
426-
self.improve_test_file(test_output)
423+
if self.tests:
424+
test_check_attempts = 1
425+
while test_check_attempts < self.MAX_IMPROVEMENT_ATTEMPTS:
427426
tests_passed, coverage, test_output = self.run_tests()
428-
else:
429-
break
430-
test_check_attempts += 1
427+
if not tests_passed or coverage < 80:
428+
self.improve_test_file(test_output)
429+
tests_passed, coverage, test_output = self.run_tests()
430+
else:
431+
break
432+
test_check_attempts += 1
431433

432434
total_tokens = sum(self.token_counts.values())
433435
print(f"\nTotal tokens used: {total_tokens}")
@@ -1011,7 +1013,7 @@ def main
10111013
type=click.Path(exists=True),
10121014
help="Path to a markdown file containing the task",
10131015
)
1014-
@click.option("--model", default="qwen2.5-coder:14b", help="The model to use for the LLM")
1016+
@click.option("--model", default="qwen2.5-coder:14b", help="The model to use for Nemo Agent")
10151017
@click.option(
10161018
"--provider",
10171019
default="ollama",
@@ -1036,6 +1038,12 @@ def main
10361038
type=click.Path(exists=True),
10371039
help="Path to the import folder containing data files",
10381040
)
1041+
@click.option(
1042+
"--tests",
1043+
default=True,
1044+
type=click.BOOL,
1045+
help="Whether to run tests after implementing the solution",
1046+
)
10391047
def cli(
10401048
task: str = None,
10411049
file: str = None,
@@ -1045,6 +1053,7 @@ def cli(
10451053
docs: str = None,
10461054
code: str = None,
10471055
data: str = None,
1056+
tests: bool = True,
10481057
):
10491058
"""
10501059
Run Nemo Agent tasks to create Python projects using uv and pytest.
@@ -1073,7 +1082,7 @@ def cli(
10731082
elif not task:
10741083
task = click.prompt("Please enter your task")
10751084

1076-
nemo_agent = NemoAgent(task=task, model=model, provider=provider)
1085+
nemo_agent = NemoAgent(task=task, model=model, provider=provider, tests=tests)
10771086

10781087
# Ingest docs if provided
10791088
if docs:

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "nemo-agent"
3-
version = "3.3.0"
3+
version = "3.4.0"
44
description = "Your Python AI Coder"
55
authors = ["Bevan Hunt <bevan@bevanhunt.com>"]
66
license = "MIT"

0 commit comments

Comments
 (0)