diff --git a/config/config2.example.yaml b/config/config2.example.yaml index b82468eed..57d6b60ad 100644 --- a/config/config2.example.yaml +++ b/config/config2.example.yaml @@ -83,3 +83,5 @@ models: # 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 +otlp_endpoint: "YOUR_OPENTELEMETRY_ENDPOINT" # URL endpoint of your OpenTelemetry collector or endpoint +otlp_headers: "YOUR_OPENTELEMETRY_HEADERS" # Authetication headers for the OpenTelemetry collector or endpoint diff --git a/metagpt/config2.py b/metagpt/config2.py index 27b228b33..41614403c 100644 --- a/metagpt/config2.py +++ b/metagpt/config2.py @@ -74,6 +74,8 @@ class Config(CLIParams, YamlModel): enable_longterm_memory: bool = False code_review_k_times: int = 2 agentops_api_key: str = "" + otlp_endpoint: str = "" + otlp_headers: str = "" # Will be removed in the future metagpt_tti_url: str = "" diff --git a/metagpt/software_company.py b/metagpt/software_company.py index 6a53ae1e5..c4944ca07 100644 --- a/metagpt/software_company.py +++ b/metagpt/software_company.py @@ -5,6 +5,7 @@ from pathlib import Path import agentops +import openlit import typer from metagpt.const import CONFIG_ROOT @@ -41,6 +42,11 @@ def generate_repo( if config.agentops_api_key != "": agentops.init(config.agentops_api_key, tags=["software_company"]) + elif config.otlp_endpoint != "": + if config.otlp_headers != "": + openlit.init(otlp_endpoint = config.otlp_endpoint, otlp_headers=config.otlp_headers) + else: + openlit.init(otlp_endpoint = config.otlp_endpoint) config.update_via_cli(project_path, project_name, inc, reqa_file, max_auto_summarize_code) ctx = Context(config=config) diff --git a/requirements.txt b/requirements.txt index 51b3d786b..d911d083e 100644 --- a/requirements.txt +++ b/requirements.txt @@ -82,6 +82,7 @@ gymnasium==0.29.1 boto3~=1.34.69 spark_ai_python~=0.3.30 agentops +openlit tree_sitter~=0.23.2 tree_sitter_python~=0.23.2 -httpx==0.27.2 \ No newline at end of file +httpx==0.27.2