From ccdfdf5d39ea8e7abb36df90b7fbcb3ff93c940c Mon Sep 17 00:00:00 2001 From: Teo Date: Mon, 25 Nov 2024 21:29:25 -0600 Subject: [PATCH] clean unnecessary headers properties Signed-off-by: Teo --- agentops/session.py | 20 -------------------- 1 file changed, 20 deletions(-) diff --git a/agentops/session.py b/agentops/session.py index cd75fa53..9e209c21 100644 --- a/agentops/session.py +++ b/agentops/session.py @@ -92,16 +92,6 @@ def __init__(self, session: Session, **kwargs): self._shutdown = False super().__init__(**kwargs) - @property - def headers(self): - # Add API key to headers along with JWT - headers = { - "Authorization": f"Bearer {self.session.jwt}", - "Content-Type": "application/json", - "X-Agentops-Api-Key": self.session.config.api_key, - } - return headers - @property def endpoint(self): return f"{self.session.config.endpoint}/v2/create_events" @@ -165,11 +155,6 @@ def export(self, spans: Sequence[ReadableSpan]) -> SpanExportResult: json.dumps({"events": events}).encode("utf-8"), api_key=self.session.config.api_key, jwt=self.session.jwt, - header={ - "Authorization": f"Bearer {self.session.jwt}", - "Content-Type": "application/json", - "X-AgentOps-Api-Key": self.session.config.api_key, - }, ) if res.code == 200: @@ -574,11 +559,6 @@ def create_agent(self, name, agent_id): serialized_payload, api_key=self.config.api_key, jwt=self.jwt, - header={ - "Authorization": f"Bearer {self.jwt}", - "Content-Type": "application/json", - "X-Agentops-Api-Key": self.config.api_key, - }, ) except ApiServerException as e: return logger.error(f"Could not create agent - {e}")