stagehand icon indicating copy to clipboard operation
stagehand copied to clipboard

LLM Inference Logging Save problems

Open Kiyi-Lee opened this issue 3 months ago • 2 comments

I've followed the offcial docs to set log_inference_to_file=True to save LLM Inference Logging, but stagehand didn't creates inference_summary/ directory.

The code I write shows below :

stagehand = Stagehand(
    env="LOCAL",
    headless=False,  # Show browser window - False

    log_inference_to_file=True,  # Creates inference_summary/ directory
    verbose=2,

    local_browser_launch_options={
        "devtools": True,  # Open developer tools
        "viewport": {"width": 1280, "height": 720},
        "executable_path": r'C:\Program Files\Google\Chrome\Application\chrome.exe',  # Custom Chrome path
        "args": [
            "--no-sandbox",
            "--disable-setuid-sandbox",
            "--disable-web-security",
            "--allow-running-insecure-content",
        ],
        "env": {
            "NODE_ENV": "development",
            "DEBUG": "true",
        },
    },

    model_name="openai/gpt-4.1-mini",
    model_api_key=os.getenv("OpenAI_API_KEY")
)

p.s.

  1. It seems that the official documentation has not been updated in time, and some configurations have become invalid. It is recommended to update the documentation.
  2. I'm trying to custom Chrome path, but it also failed.
  3. The introduction of how to use Agent is not sufficient, especially the model setting. Does it only can use computer-use-preview for OpenAI ? I'm trying to use gpt-4o, but it suggests me it's not available.

Kiyi-Lee avatar Oct 24 '25 06:10 Kiyi-Lee

this is JS code?

JerryWu1234 avatar Oct 29 '25 07:10 JerryWu1234

this is JS code?

It's python.

Kiyi-Lee avatar Oct 30 '25 07:10 Kiyi-Lee