-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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 tools integration #7177
base: main
Are you sure you want to change the base?
Stagehand tools integration #7177
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
1 Skipped Deployment
|
If you plan to run the browser locally, you'll also need to install Playwright's browser dependencies. | ||
|
||
```bash | ||
npm exec playwright install |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this be npx
instead?
```typescript | ||
import { Stagehand } from "@browserbasehq/stagehand"; | ||
import { StagehandActTool } from "./StagehandActTool"; | ||
import { initializeAgentExecutor } from "@langchain/agents"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah this is quite old, we should show how to use this with LangGraph instead:
https://langchain-ai.github.io/langgraphjs/how-tos/create-react-agent/?h=create#code
@@ -0,0 +1,42 @@ | |||
import { StagehandToolkit } from "@langchain/community/agents/toolkits/stagehand"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just import it into your .mdx
file so that you get type checking, linting etc.
@@ -65,6 +65,7 @@ export const config = { | |||
"agents/toolkits/aws_sfn": "agents/toolkits/aws_sfn", | |||
"agents/toolkits/base": "agents/toolkits/base", | |||
"agents/toolkits/connery": "agents/toolkits/connery/index", | |||
"agents/toolkits/stagehand": "agents/toolkits/stagehand", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also need to add this to requiresOptionalDependencies
below
@@ -190,6 +192,7 @@ | |||
"node-llama-cpp": "3.1.1", | |||
"notion-to-md": "^3.1.0", | |||
"officeparser": "^4.0.4", | |||
"openai": "^4.72.0", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did we need to add this?
} | ||
} | ||
|
||
abstract class StagehandToolBase extends Tool { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You probably want to extend StructuredTool
instead since you can specify Zod schemas for tool inputs
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! See comments, please also remember to run yarn format
and yarn lint
.
This PR introduces an integration of Langchain with Stagehand, the best in class AI web automation framework from Browserbase HQ.
Users can now use Stagehand web navigation tooling to power their agents with simple atomic web interactions!