Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[stagehand::base_cache] uncaught exception #400

Open
bigxalx opened this issue Jan 10, 2025 · 3 comments
Open

[stagehand::base_cache] uncaught exception #400

bigxalx opened this issue Jan 10, 2025 · 3 comments

Comments

@bigxalx
Copy link

bigxalx commented Jan 10, 2025

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?

@kamath
Copy link
Contributor

kamath commented Jan 13, 2025

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!

@bigxalx
Copy link
Author

bigxalx commented Jan 17, 2025

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.

@kamath
Copy link
Contributor

kamath commented Jan 18, 2025

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants