You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using Node 18.1.0, or lower, on both Ubuntu 20.0.4 and Windows 10:
Attempting to use the method .call() results in a 400 status code.
Here is my code:
import { ChatOpenAI } from "langchain/chat_models"
import { HumanChatMessage } from 'langchain/schema'
import dotenv from 'dotenv'
dotenv.config()
const chat = new ChatOpenAI({
openAIApiKey: process.env.OPENAI_API_KEY,
temperature: 0.9
})
async function getChat() {
const response = await chat.call([
new HumanChatMessage(
"Translate this sentence from English to French. I love programming."
),
]);
}
getChat()
Things I have tried:
Instead of passing the openAIApiKey as a parameter with .call(), I instead ran package.json script: npm run dev which was defined as node -r dotenv/config index.js
Downgrading to Node 16.8.0 and setting NODE_ENV to experimental
Downgrading the version of langchain to 0.0.22
TEMPORARY SOLUTION
After changing my Node version to 18.2.0, the error does NOT happen!
What I suspect may be the cause:
Something with AxiosFetchAdapter...that's the only thing I can think of!
The text was updated successfully, but these errors were encountered:
In general it's not recommended to stick with old minor versions of Node. We only support running Langchain on the most recent versions of Node.js 16.x, 18.x, 19.x
Greetings,
When using Node 18.1.0, or lower, on both Ubuntu 20.0.4 and Windows 10:
Attempting to use the method
.call()
results in a 400 status code.Here is my code:
Things I have tried:
npm run dev
which was defined asnode -r dotenv/config index.js
TEMPORARY SOLUTION
After changing my Node version to 18.2.0, the error does NOT happen!
What I suspect may be the cause:
Something with AxiosFetchAdapter...that's the only thing I can think of!
The text was updated successfully, but these errors were encountered: