Skip to content

Commit

Permalink
feat(langchain): Infer o1 model strings in initChatModel (langchain-a…
Browse files Browse the repository at this point in the history
  • Loading branch information
jacoblee93 authored and syntaxsec committed Dec 13, 2024
1 parent ba56d19 commit 14f8e20
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion langchain/src/chat_models/universal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down

0 comments on commit 14f8e20

Please sign in to comment.