Replies: 1 comment
-
Hello @MicleMing! 👋 I'm here to help you with any bugs, questions, and becoming a contributor. Let's tackle this together! To customize the API base for import { OpenAI } from "@langchain/openai";
const model = new OpenAI(
{ temperature: 1, openAIApiKey: 'xxx', modelName: 'glm-4' },
{ baseURL: "https://open.bigmodel.cn/api/paas/v4/" }
);
const message = await model.invoke("Hi there!");
console.log(message);
/*
AIMessage {
content: 'Hello! How can I assist you today?',
additional_kwargs: { function_call: undefined }
}
*/ Replace |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Example Code
Description
I'm trying to use ChatOpenAI to connect GLM which compatible with OpenAI API, so I need change api base from openai to GML. but it seems not support to change api base now.
System Info
Node
Beta Was this translation helpful? Give feedback.
All reactions