From f94894605488f3f79856f9079cf3fffba32a8c7d Mon Sep 17 00:00:00 2001 From: Patcher Date: Mon, 16 Dec 2024 11:30:42 +0530 Subject: [PATCH 1/5] Add otlp_headers and otlp_endpoint to misc --- metagpt/config2.py | 2 ++ 1 file changed, 2 insertions(+) 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 = "" From 7189fc29703d5b42cfeccba59be59074f28b35a5 Mon Sep 17 00:00:00 2001 From: Patcher Date: Mon, 16 Dec 2024 11:31:13 +0530 Subject: [PATCH 2/5] Update requirements.txt --- requirements.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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 From 364611337f0743b868db078c74b0ae8e5195d914 Mon Sep 17 00:00:00 2001 From: Patcher Date: Mon, 16 Dec 2024 11:33:35 +0530 Subject: [PATCH 3/5] Update software_company.py --- metagpt/software_company.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/metagpt/software_company.py b/metagpt/software_company.py index 6a53ae1e5..a86ddf84d 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_endpoint != "": + 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) From 5132708b96cf04e3266e509eebacc4946d2f19e6 Mon Sep 17 00:00:00 2001 From: Patcher Date: Mon, 16 Dec 2024 11:35:26 +0530 Subject: [PATCH 4/5] Update config2.example.yaml --- config/config2.example.yaml | 2 ++ 1 file changed, 2 insertions(+) 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 From 5720b2f94dc9db8a69bad8fd50cb23a01025e0d5 Mon Sep 17 00:00:00 2001 From: Patcher Date: Mon, 16 Dec 2024 11:38:26 +0530 Subject: [PATCH 5/5] Update software_company.py --- metagpt/software_company.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/metagpt/software_company.py b/metagpt/software_company.py index a86ddf84d..c4944ca07 100644 --- a/metagpt/software_company.py +++ b/metagpt/software_company.py @@ -43,7 +43,7 @@ def generate_repo( if config.agentops_api_key != "": agentops.init(config.agentops_api_key, tags=["software_company"]) elif config.otlp_endpoint != "": - if 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)