fixbug: startup parameters do not match

This commit is contained in:
莘权 马 2023-07-28 15:33:52 +08:00
parent 5725296b1c
commit 686ca23478
2 changed files with 17 additions and 15 deletions

View file

@ -1,7 +1,7 @@
aiohttp==3.8.4
#azure_storage==0.37.0
azure-cognitiveservices-speech==1.30.0
channels==4.0.0
# chromadb==0.3.22
chromadb==0.3.22
# Django==4.1.5
# docx==0.2.4
duckduckgo_search==2.9.4
@ -19,7 +19,7 @@ openpyxl
pandas==1.4.1
pydantic==1.10.7
#pygame==2.1.3
#pymilvus==2.2.8
pymilvus==2.2.8
pytest==7.2.2
python_docx==0.8.11
PyYAML==6.0
@ -29,10 +29,13 @@ tenacity==8.2.2
tiktoken==0.3.3
tqdm==4.64.0
#unstructured[local-inference]
# playwright
# selenium>4
# webdriver_manager<3.9
playwright
selenium>4
webdriver_manager<3.9
anthropic==0.3.6
typing-inspect==0.8.0
typing_extensions==4.5.0
aiofiles
bs4
aiofiles
pytest
pytest-asyncio

View file

@ -1,7 +1,7 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
@Modified By: mashenquan, 2023-07-27, +industry concept
@Modified By: mashenquan, 2023-07-27, + `industry` concept
"""
import asyncio
@ -15,9 +15,9 @@ from metagpt.roles.teacher import Teacher
from metagpt.software_company import SoftwareCompany
async def software_startup(investment: float = 3.0, n_round: int = 5, code_review: bool = False, *args, **kwargs):
async def software_startup(idea: str, investment: float = 3.0, n_round: int = 5, *args, **kwargs):
"""Run a startup. Be a boss in software industry."""
idea = kwargs['idea'] # Your innovative idea, such as "Creating a snake game."
code_review = kwargs.get("code_review", False) # Whether to use code review.
company = SoftwareCompany()
company.hire([ProductManager(),
Architect(),
@ -28,7 +28,7 @@ async def software_startup(investment: float = 3.0, n_round: int = 5, code_revie
await company.run(n_round=n_round)
async def education_startup(investment: float = 3.0, n_round: int = 5, code_review: bool = False, *args, **kwargs):
async def education_startup(lesson_file: str, investment: float = 3.0, n_round: int = 1, *args, **kwargs):
"""Run a startup. Be a teacher in education industry."""
demo_lesson = """
@ -76,7 +76,6 @@ async def education_startup(investment: float = 3.0, n_round: int = 5, code_revi
"""
lesson = ""
lesson_file = kwargs.get('lesson_file')
if lesson_file is not None and Path(lesson_file).exists():
async with aiofiles.open(lesson_file, mode="r", encoding="utf-8") as reader:
lesson = await reader.read()
@ -92,12 +91,12 @@ async def education_startup(investment: float = 3.0, n_round: int = 5, code_revi
await company.run(n_round=1)
def main(investment: float = 3.0, n_round: int = 5, code_review: bool = False, *args, **kwargs):
def main(idea: str, investment: float = 3.0, n_round: int = 5, *args, **kwargs):
"""
We are a software startup comprised of AI. By investing in us, you are empowering a future filled with limitless possibilities.
:param idea: Your innovative idea for `software` industry, such as "Creating a snake game."; lesson filename for `education` industry.
:param investment: As an investor, you have the opportunity to contribute a certain dollar amount to this AI company.
:param n_round:
:param code_review: Whether to use code review.
:param args: Parameters passed in format: `python your_script.py arg1 arg2 arg3`
:param kwargs: Parameters passed in format: `python your_script.py a--param1=value1 --param2=value2`
:return:
@ -111,7 +110,7 @@ def main(investment: float = 3.0, n_round: int = 5, code_review: bool = False, *
if startup is None:
print(f"Available industries:{list(industries.keys())}")
return
asyncio.run(startup(investment, n_round, code_review, *args, **kwargs))
asyncio.run(startup(idea, investment, n_round, *args, **kwargs))
if __name__ == '__main__':