mirror of
https://github.com/FoundationAgents/MetaGPT.git
synced 2026-06-08 15:05:17 +02:00
feature: 主流程支持配置agentops
This commit is contained in:
parent
a3699128d1
commit
bbb65c9669
10 changed files with 28 additions and 2 deletions
2
.github/workflows/unittest.yaml
vendored
2
.github/workflows/unittest.yaml
vendored
|
|
@ -39,7 +39,7 @@ jobs:
|
|||
- name: Show failed tests and overall summary
|
||||
run: |
|
||||
grep -E "FAILED tests|ERROR tests|[0-9]+ passed," unittest.txt
|
||||
failed_count=$(grep -E "FAILED|ERROR" unittest.txt | wc -l)
|
||||
failed_count=$(grep -E "FAILED tests|ERROR tests|[0-9]+ passed," unittest.txt | wc -l)
|
||||
if [[ "$failed_count" -gt 0 ]]; then
|
||||
echo "$failed_count failed lines found! Task failed."
|
||||
exit 1
|
||||
|
|
|
|||
|
|
@ -76,4 +76,6 @@ models:
|
|||
# proxy: "YOUR_PROXY" # for LLM API requests
|
||||
# # timeout: 600 # Optional. If set to 0, default value is 300.
|
||||
# # Details: https://azure.microsoft.com/en-us/pricing/details/cognitive-services/openai-service/
|
||||
# pricing_plan: "" # Optional. Use for Azure LLM when its model name is not the same as OpenAI's
|
||||
# pricing_plan: "" # Optional. Use for Azure LLM when its model name is not the same as OpenAI's
|
||||
|
||||
agentops_api_key: "YOUR_AGENTOPS_API_KEY" # get key from https://app.agentops.ai/settings/projects
|
||||
|
|
|
|||
|
|
@ -69,6 +69,7 @@ class Config(CLIParams, YamlModel):
|
|||
workspace: WorkspaceConfig = WorkspaceConfig()
|
||||
enable_longterm_memory: bool = False
|
||||
code_review_k_times: int = 2
|
||||
agentops_api_key: str = ""
|
||||
|
||||
# Will be removed in the future
|
||||
metagpt_tti_url: str = ""
|
||||
|
|
|
|||
|
|
@ -6,11 +6,14 @@
|
|||
@File : architect.py
|
||||
"""
|
||||
|
||||
import agentops
|
||||
|
||||
from metagpt.actions import WritePRD
|
||||
from metagpt.actions.design_api import WriteDesign
|
||||
from metagpt.roles.role import Role
|
||||
|
||||
|
||||
@agentops.track_agent(name="Architect")
|
||||
class Architect(Role):
|
||||
"""
|
||||
Represents an Architect role in a software development process.
|
||||
|
|
|
|||
|
|
@ -24,6 +24,8 @@ from collections import defaultdict
|
|||
from pathlib import Path
|
||||
from typing import Optional, Set
|
||||
|
||||
import agentops
|
||||
|
||||
from metagpt.actions import Action, WriteCode, WriteCodeReview, WriteTasks
|
||||
from metagpt.actions.fix_bug import FixBug
|
||||
from metagpt.actions.project_management_an import REFINED_TASK_LIST, TASK_LIST
|
||||
|
|
@ -58,6 +60,7 @@ otherwise, answer 'YES' in JSON format.
|
|||
"""
|
||||
|
||||
|
||||
@agentops.track_agent(name="Engineer")
|
||||
class Engineer(Role):
|
||||
"""
|
||||
Represents an Engineer role responsible for writing and possibly reviewing code.
|
||||
|
|
|
|||
|
|
@ -7,12 +7,15 @@
|
|||
@Modified By: mashenquan, 2023/11/27. Add `PrepareDocuments` action according to Section 2.2.3.5.1 of RFC 135.
|
||||
"""
|
||||
|
||||
import agentops
|
||||
|
||||
from metagpt.actions import UserRequirement, WritePRD
|
||||
from metagpt.actions.prepare_documents import PrepareDocuments
|
||||
from metagpt.roles.role import Role, RoleReactMode
|
||||
from metagpt.utils.common import any_to_name
|
||||
|
||||
|
||||
@agentops.track_agent(name="ProductManager")
|
||||
class ProductManager(Role):
|
||||
"""
|
||||
Represents a Product Manager role responsible for product development and management.
|
||||
|
|
|
|||
|
|
@ -6,11 +6,14 @@
|
|||
@File : project_manager.py
|
||||
"""
|
||||
|
||||
import agentops
|
||||
|
||||
from metagpt.actions import WriteTasks
|
||||
from metagpt.actions.design_api import WriteDesign
|
||||
from metagpt.roles.role import Role
|
||||
|
||||
|
||||
@agentops.track_agent(name="ProjectManager")
|
||||
class ProjectManager(Role):
|
||||
"""
|
||||
Represents a Project Manager role responsible for overseeing project execution and team efficiency.
|
||||
|
|
|
|||
|
|
@ -15,6 +15,8 @@
|
|||
of SummarizeCode.
|
||||
"""
|
||||
|
||||
import agentops
|
||||
|
||||
from metagpt.actions import DebugError, RunCode, WriteTest
|
||||
from metagpt.actions.summarize_code import SummarizeCode
|
||||
from metagpt.const import MESSAGE_ROUTE_TO_NONE
|
||||
|
|
@ -24,6 +26,7 @@ from metagpt.schema import Document, Message, RunCodeContext, TestingContext
|
|||
from metagpt.utils.common import any_to_str_set, parse_recipient
|
||||
|
||||
|
||||
@agentops.track_agent(name="QaEngineer")
|
||||
class QaEngineer(Role):
|
||||
name: str = "Edward"
|
||||
profile: str = "QaEngineer"
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@
|
|||
import asyncio
|
||||
from pathlib import Path
|
||||
|
||||
import agentops
|
||||
import typer
|
||||
|
||||
from metagpt.const import CONFIG_ROOT
|
||||
|
|
@ -38,6 +39,9 @@ def generate_repo(
|
|||
)
|
||||
from metagpt.team import Team
|
||||
|
||||
if config.agentops_api_key != "":
|
||||
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)
|
||||
|
||||
|
|
@ -68,6 +72,9 @@ 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
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -74,3 +74,4 @@ rank-bm25==0.2.2 # for tool recommendation
|
|||
gymnasium==0.29.1
|
||||
boto3~=1.34.69
|
||||
spark_ai_python~=0.3.30
|
||||
agentops
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue