From a4f2204b196599a77afb1c23d1e8c5171173c88c Mon Sep 17 00:00:00 2001 From: jacoblee93 Date: Wed, 24 Jul 2024 10:23:51 -0700 Subject: [PATCH] Make legacy OpenAI path respect a passed model --- libs/langchain-openai/src/legacy.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libs/langchain-openai/src/legacy.ts b/libs/langchain-openai/src/legacy.ts index 16e0452af2e2..f9c18f0f8cfb 100644 --- a/libs/langchain-openai/src/legacy.ts +++ b/libs/langchain-openai/src/legacy.ts @@ -191,7 +191,7 @@ export class OpenAIChat fields?.configuration?.organization ?? getEnvironmentVariable("OPENAI_ORGANIZATION"); - this.modelName = fields?.modelName ?? this.modelName; + this.modelName = fields?.model ?? fields?.modelName ?? this.modelName; this.prefixMessages = fields?.prefixMessages ?? this.prefixMessages; this.modelKwargs = fields?.modelKwargs ?? {}; this.timeout = fields?.timeout;