From cabb754946d94ef1a2965eafb229f7aa2c5ae6a9 Mon Sep 17 00:00:00 2001 From: Friedrich Wessel Date: Wed, 30 Oct 2024 13:38:16 +0100 Subject: [PATCH] add o1-preview support --- plugins/openai/src/gpt.ts | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/plugins/openai/src/gpt.ts b/plugins/openai/src/gpt.ts index 39bad265..f8bc2dec 100644 --- a/plugins/openai/src/gpt.ts +++ b/plugins/openai/src/gpt.ts @@ -58,6 +58,7 @@ const MODELS_SUPPORTING_OPENAI_RESPONSE_FORMAT = [ 'gpt-3.5-turbo-0125', 'gpt-3.5-turbo', 'gpt-3.5-turbo-1106', + 'o1-preview', ]; export const OpenAiConfigSchema = GenerationCommonConfigSchema.extend({ @@ -91,6 +92,22 @@ export const gpt4o = modelRef({ configSchema: OpenAiConfigSchema, }); +export const o1Preview = modelRef({ + name: 'openai/o1-preview', + info: { + versions: ['o1-preview'], + label: 'OpenAI - O1 Preview', + supports: { + multiturn: true, + tools: false, + media: false, + systemRole: false, + output: ['text'], + }, + }, + configSchema: OpenAiConfigSchema, +}); + export const gpt4oMini = modelRef({ name: 'openai/gpt-4o-mini', info: { @@ -184,6 +201,7 @@ export const SUPPORTED_GPT_MODELS = { 'gpt-4-vision': gpt4Vision, 'gpt-4': gpt4, 'gpt-3.5-turbo': gpt35Turbo, + 'o1-preview': o1Preview, }; export function toOpenAIRole(role: Role): ChatCompletionRole {