Our new LangChain Academy Course Deep Research with LangGraph is now live! Enroll for free.
OSS (v1-alpha)
LangChain and LangGraph
npm install @langchain/openai @langchain/core
/* eslint-disable no-process-env */ import { DallEAPIWrapper } from "@langchain/openai"; const tool = new DallEAPIWrapper({ n: 1, // Default model: "dall-e-3", // Default apiKey: process.env.OPENAI_API_KEY, // Default }); const imageURL = await tool.invoke("a painting of a cat"); console.log(imageURL);