stagehand icon indicating copy to clipboard operation
stagehand copied to clipboard

[stagehand::base_cache] uncaught exception

Open bigxalx opened this issue 1 year ago • 3 comments

Trying the ai_sdk_example.

[stagehand::init] launching local browser [stagehand::init] local browser started successfully. [stagehand::extract] running extract [stagehand::extraction] starting extraction using old approach [stagehand::extraction] received output from processDom. [stagehand::anthropic] creating chat completion [stagehand::base_cache] Lock acquired [stagehand::base_cache] Lock released [stagehand::llm_cache] LLM cache miss - no cached response found [stagehand::extract] error extracting [stagehand::llm_cache] cleaning up cache [stagehand::base_cache] Lock acquired [stagehand::base_cache] no cache entries found for requestId [stagehand::base_cache] Lock released [stagehand::base_cache] uncaught exception [stagehand::base_cache] uncaught exception

Tried removing the ADISDKClient and using modelName: "claude-3-5-sonnet-latest" but no luck. Added claude api key, 2048 example works.

What am I doing wrong?

bigxalx avatar Jan 10 '25 15:01 bigxalx

Hey! If you go to stagehand.config.ts, can you remove this line and then paste the error trace here?

We have a custom logger that keeps logs readable, but a more detailed error trace would help a lot for us to repro!

kamath avatar Jan 13 '25 00:01 kamath

Thanks, that helped debug it! Got an authentication error claiming Anthropic API key was missing, even though I've added it in the env vars and it worked in the 2048 example. Turns out, removing the stagehand config from the new stagehand initialization fixes it:

  const stagehand = new Stagehand({
    // ...StagehandConfig,
    env: "LOCAL",
    verbose: 1,
    debugDom: true,
    domSettleTimeoutMs: 100,
    modelName: "claude-3-5-sonnet-latest",
  });

Note the commented out line.

bigxalx avatar Jan 17 '25 22:01 bigxalx

Ah, that likely means there's some default config that's conflicting with Vercel AI SDK. Thanks so much for the feedback!

kamath avatar Jan 18 '25 22:01 kamath