Skip to content

Commit

Permalink
Infer o1 model strings in initChatModel
Browse files Browse the repository at this point in the history
  • Loading branch information
jacoblee93 committed Dec 11, 2024
1 parent 1b7e34e commit a6e99b0
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 a6e99b0

Please sign in to comment.