From 15e9461de9222521a67a023754c4ad6609b003d9 Mon Sep 17 00:00:00 2001 From: Camilo Zapata Date: Wed, 4 Dec 2024 11:36:36 -0500 Subject: [PATCH] fix: runtime_tag added as header instead of payload (#315) runtime_tag added as header instead of payload --- vision_agent/tools/tool_utils.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/vision_agent/tools/tool_utils.py b/vision_agent/tools/tool_utils.py index 6f0dd8f7..3ed6b8d2 100644 --- a/vision_agent/tools/tool_utils.py +++ b/vision_agent/tools/tool_utils.py @@ -41,11 +41,6 @@ def send_inference_request( metadata_payload: Optional[Dict[str, Any]] = None, is_form: bool = False, ) -> Any: - # TODO: runtime_tag and function_name should be metadata_payload and not included - # in the service payload - if runtime_tag := os.environ.get("RUNTIME_TAG", ""): - payload["runtime_tag"] = runtime_tag - url = f"{_LND_API_URL_v2 if v2 else _LND_API_URL}/{endpoint_name}" if "TOOL_ENDPOINT_URL" in os.environ: url = os.environ["TOOL_ENDPOINT_URL"] @@ -55,6 +50,9 @@ def send_inference_request( headers["Authorization"] = os.environ["TOOL_ENDPOINT_AUTH"] headers.pop("apikey") + if runtime_tag := os.environ.get("RUNTIME_TAG", ""): + headers["runtime_tag"] = runtime_tag + session = _create_requests_session( url=url, num_retry=3,