Skip to content

Commit

Permalink
clean unnecessary headers properties
Browse files Browse the repository at this point in the history
Signed-off-by: Teo <[email protected]>
  • Loading branch information
teocns committed Nov 26, 2024
1 parent cfb3afa commit ccdfdf5
Showing 1 changed file with 0 additions and 20 deletions.
20 changes: 0 additions & 20 deletions agentops/session.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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}")
Expand Down

0 comments on commit ccdfdf5

Please sign in to comment.