-
Notifications
You must be signed in to change notification settings - Fork 5.3k
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
Enhanced few code files in the main branch. #1522
Open
vignesh1507
wants to merge
3
commits into
geekan:main
Choose a base branch
from
vignesh1507:main
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,7 +4,6 @@ | |
import asyncio | ||
from pathlib import Path | ||
|
||
import agentops | ||
import typer | ||
|
||
from metagpt.const import CONFIG_ROOT | ||
|
@@ -39,9 +38,6 @@ def generate_repo( | |
) | ||
from metagpt.team import Team | ||
|
||
if config.agentops_api_key != "": | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why was agentops removed? |
||
agentops.init(config.agentops_api_key, tags=["software_company"]) | ||
|
||
config.update_via_cli(project_path, project_name, inc, reqa_file, max_auto_summarize_code) | ||
ctx = Context(config=config) | ||
|
||
|
@@ -72,9 +68,6 @@ def generate_repo( | |
company.run_project(idea) | ||
asyncio.run(company.run(n_round=n_round)) | ||
|
||
if config.agentops_api_key != "": | ||
agentops.end_session("Success") | ||
|
||
return ctx.repo | ||
|
||
|
||
|
@@ -87,7 +80,7 @@ def startup( | |
run_tests: bool = typer.Option(default=False, help="Whether to enable QA for adding & running tests."), | ||
implement: bool = typer.Option(default=True, help="Enable or disable code implementation."), | ||
project_name: str = typer.Option(default="", help="Unique project name, such as 'game_2048'."), | ||
inc: bool = typer.Option(default=False, help="Incremental mode. Use it to coop with existing repo."), | ||
inc: bool = typer.Option(default=False, help="Incremental mode. Use it to cope with existing repo."), | ||
project_path: str = typer.Option( | ||
default="", | ||
help="Specify the directory path of the old version project to fulfill the incremental requirements.", | ||
|
@@ -130,10 +123,9 @@ def startup( | |
|
||
DEFAULT_CONFIG = """# Full Example: https://github.com/geekan/MetaGPT/blob/main/config/config2.example.yaml | ||
# Reflected Code: https://github.com/geekan/MetaGPT/blob/main/metagpt/config2.py | ||
# Config Docs: https://docs.deepwisdom.ai/main/en/guide/get_started/configuration.html | ||
llm: | ||
api_type: "openai" # or azure / ollama / groq etc. | ||
model: "gpt-4-turbo" # or gpt-3.5-turbo | ||
api_type: "openai" # or azure / ollama / open_llm etc. Check LLMType for more options | ||
model: "gpt-4-turbo-preview" # or gpt-3.5-turbo-1106 / gpt-4-1106-preview | ||
base_url: "https://api.openai.com/v1" # or forward url / other llm url | ||
api_key: "YOUR_API_KEY" | ||
""" | ||
|
@@ -143,16 +135,16 @@ def copy_config_to(): | |
"""Initialize the configuration file for MetaGPT.""" | ||
target_path = CONFIG_ROOT / "config2.yaml" | ||
|
||
# 创建目标目录(如果不存在) | ||
# 创建目标目录(如果不存在)/ Create the target directory if it does not exist | ||
target_path.parent.mkdir(parents=True, exist_ok=True) | ||
|
||
# 如果目标文件已经存在,则重命名为 .bak | ||
# 如果目标文件已经存在,则重命名为 .bak / If the target file already exists, rename it to .bak | ||
if target_path.exists(): | ||
backup_path = target_path.with_suffix(".bak") | ||
target_path.rename(backup_path) | ||
print(f"Existing configuration file backed up at {backup_path}") | ||
|
||
# 复制文件 | ||
# 复制文件 / Copy files | ||
target_path.write_text(DEFAULT_CONFIG, encoding="utf-8") | ||
print(f"Configuration file initialized at {target_path}") | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -130,7 +130,12 @@ async def run(self, n_round=3, idea="", send_to="", auto_archive=True): | |
logger.debug("All roles are idle.") | ||
break | ||
n_round -= 1 | ||
self._check_balance() | ||
try: | ||
self._check_balance() | ||
except NoMoneyException as e: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. already has a |
||
logger.error(f"Project stopped due to insufficient funds: {e}") | ||
break | ||
|
||
await self.env.run() | ||
|
||
logger.debug(f"max {n_round=} left.") | ||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks like this changes have reverted the feature introduced in PR #1124, which allowed the
define_log_level
method to control stream logging via theprint_level
parameter. Could you please clarify the reason for this change?