generated from remarkablemark/npm-package-typescript-template
-
-
Notifications
You must be signed in to change notification settings - Fork 0
Anthropic
Mark edited this page Jun 27, 2025
·
2 revisions
NPM:
npm install @langchain/anthropic --save-devYarn:
yarn add @langchain/anthropic --devCreate cypress.env.json:
touch cypress.env.jsonSet your Anthropic API key:
{
"ANTHROPIC_API_KEY": "sk-ant-api..."
}Set the LLM with cy.aiConfig:
import { ChatAnthropic } from '@langchain/anthropic'
import { prompt } from 'cy-ai'
const llm = new ChatAnthropic({
model: 'claude-sonnet-4-0',
apiKey: Cypress.env('ANTHROPIC_API_KEY'),
})
const chain = prompt.pipe(llm)
before(() => {
cy.aiConfig({ llm: chain });
})Write your test:
it('visits example.com', () => {
cy.visit('/')
cy.ai('see heading "Example Domain"')
})