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

Error whenever using act() #465

Open
Kolgann opened this issue Feb 5, 2025 · 2 comments
Open

Error whenever using act() #465

Kolgann opened this issue Feb 5, 2025 · 2 comments

Comments

@Kolgann
Copy link

Kolgann commented Feb 5, 2025

First of all - I'm new to stagehand, and I don't have a subscription to either OpenAI or Anthropic, so my only testing has been a local LLM with Ollama (w/ llama3.2).

I've been having a lot of success with reading information from a webpage using extract(), but I have not been able to do anything with act(). It seems like if I'm including some data (such as text) that I'm asking it to work with, like in this example:

await stagehand.page.goto("https://google.com/");
await page.act({ action: "type the text 'test' in the search field" });

I get an error like this:

 Cannot assign to read only property '0' of string '["search field"]'
 TypeError: Cannot assign to read only property '0' of string '["search field"]'
    at {my working path}\node_modules\@browserbasehq\stagehand\dist\index.js:3269:29
    at Array.forEach (<anonymous>)
    at StagehandActHandler.<anonymous> ({my working path}\node_modules\@browserbasehq\stagehand\dist\index.js:3267:26)
    at Generator.next (<anonymous>)
    at fulfilled ({my working path}\node_modules\@browserbasehq\stagehand\dist\index.js:63:24)

If it's a simple action with no data to handle, like this example:

await stagehand.page.goto("https://google.com/");
await page.act({ action: "click the `I'm Feeling Lucky` button" });

I get this instead:

 args is not iterable
 TypeError: args is not iterable
    at StagehandActHandler.<anonymous> (F:\Gannon Workspace\Tools\stagehand\ollama-test-from-template\node_modules\@browserbasehq\stagehand\dist\index.js:3265:36)
    at Generator.next (<anonymous>)
    at fulfilled (F:\Gannon Workspace\Tools\stagehand\ollama-test-from-template\node_modules\@browserbasehq\stagehand\dist\index.js:63:24)

I followed the quickstart guide and my code is basically just the custom-client-ollama example that I'm using to experiment with act(). I greatly appreciate any help, really hoping to get this working as stagehand seems like a very cool project!

@kamath
Copy link
Contributor

kamath commented Feb 6, 2025

Ah man, sorry you're running into this issue! What model are you trying? Does it support tool calling?

@Kolgann
Copy link
Author

Kolgann commented Feb 6, 2025

@kamath Thanks for the reply - I'm using llama3.2 (since that's what I saw in this example, which I'm pretty sure supports tool calling.

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