Skip to main content

Prepare the environment

  • Node.js (v20.19.4 or higher)
  • npm (v10.9.0 or higher)
First, we recommend using Node.js to setup the Node.js environment.
Install the dependencies:
Then install playwright:

Create an agent

Then you can use the agent as follows:

Set up your LLM API keys

Add your API keys for the provider you want to use to your .env file.
ChatOpenAI and other Langchain chat models require API keys. You should store these in your .env file. For example, for OpenAI and Anthropic, you can set the API keys in your .env file, such as:
.env
For other LLM models you can refer to the Supported Models page to find how to set them up with their specific API keys.

Run the example