From a823f8245d7390276d1536c754fd84f97e2ec6a1 Mon Sep 17 00:00:00 2001 From: miguel Date: Wed, 25 Jun 2025 14:08:36 -0700 Subject: [PATCH 1/2] add missing sent at header --- CHANGELOG.md | 1 + CHANGELOG.txt | 10 ---------- stagehand/api.py | 4 +++- 3 files changed, 4 insertions(+), 11 deletions(-) create mode 100644 CHANGELOG.md delete mode 100644 CHANGELOG.txt diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..6b52c0f --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1 @@ +# Stagehand Python Changelog diff --git a/CHANGELOG.txt b/CHANGELOG.txt deleted file mode 100644 index b5269eb..0000000 --- a/CHANGELOG.txt +++ /dev/null @@ -1,10 +0,0 @@ -# Stagehand Python SDK Changelog - -## 0.3.4 (2025-04-05) -- Fixed AgentExecuteResult schema - -## 0.3.3 (2025-04-04) -- Fixed logs - -## 0.3.0 -- Initial public release \ No newline at end of file diff --git a/stagehand/api.py b/stagehand/api.py index ff8601c..51b283f 100644 --- a/stagehand/api.py +++ b/stagehand/api.py @@ -1,6 +1,6 @@ import json from typing import Any - +from datetime import datetime from .utils import convert_dict_keys_to_camel_case __all__ = ["_create_session", "_execute"] @@ -67,6 +67,7 @@ async def _create_session(self): "x-bb-project-id": self.browserbase_project_id, "x-model-api-key": self.model_api_key, "Content-Type": "application/json", + "x-sent-at": datetime.now().isoformat(), "x-language": "python", } @@ -96,6 +97,7 @@ async def _execute(self, method: str, payload: dict[str, Any]) -> Any: "x-bb-project-id": self.browserbase_project_id, "Content-Type": "application/json", "Connection": "keep-alive", + "x-sent-at": datetime.now().isoformat(), # Always enable streaming for better log handling "x-stream-response": "true", } From 2c87ec2ec4a2941c8b7d1ac083455e970eb3deb6 Mon Sep 17 00:00:00 2001 From: miguel Date: Wed, 25 Jun 2025 14:10:18 -0700 Subject: [PATCH 2/2] formatting --- stagehand/api.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/stagehand/api.py b/stagehand/api.py index 51b283f..28eb216 100644 --- a/stagehand/api.py +++ b/stagehand/api.py @@ -1,6 +1,7 @@ import json -from typing import Any from datetime import datetime +from typing import Any + from .utils import convert_dict_keys_to_camel_case __all__ = ["_create_session", "_execute"]