From a6e99b0eae974d4a0008382c3b5fd697f08034cf Mon Sep 17 00:00:00 2001 From: jacoblee93 Date: Wed, 11 Dec 2024 09:37:18 -0800 Subject: [PATCH] Infer o1 model strings in initChatModel --- langchain/src/chat_models/universal.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/langchain/src/chat_models/universal.ts b/langchain/src/chat_models/universal.ts index 5c9c6fc6d0dd..a61b1a5b4cb6 100644 --- a/langchain/src/chat_models/universal.ts +++ b/langchain/src/chat_models/universal.ts @@ -175,7 +175,11 @@ async function _initChatModelHelper( * _inferModelProvider("unknown-model"); // returns undefined */ export function _inferModelProvider(modelName: string): string | undefined { - if (modelName.startsWith("gpt-3") || modelName.startsWith("gpt-4")) { + if ( + modelName.startsWith("gpt-3") || + modelName.startsWith("gpt-4") || + modelName.startsWith("o1") + ) { return "openai"; } else if (modelName.startsWith("claude")) { return "anthropic";