diff --git a/src/components/projects/projectId/attributes/attributeId/LLM/models/OpenAI.tsx b/src/components/projects/projectId/attributes/attributeId/LLM/models/OpenAI.tsx
index 745ab6c3..59659e5d 100644
--- a/src/components/projects/projectId/attributes/attributeId/LLM/models/OpenAI.tsx
+++ b/src/components/projects/projectId/attributes/attributeId/LLM/models/OpenAI.tsx
@@ -2,22 +2,22 @@ import { useEffect } from "react";
import KernDropdown from "@/submodules/react-components/components/KernDropdown";
import { InputWithSlider } from "@/submodules/react-components/components/InputWithSlider";
import { LLmPropsOpenAI } from "../types";
+import OpenAIoSeriesSwitch from "./OpenAIoSeriesSwitch";
// https://platform.openai.com/docs/models
-const MODEL_OPTIONS = ['gpt-4o-mini', 'gpt-4o', 'gpt-4', 'gpt-4-turbo-preview', 'gpt-4-1106-preview', 'gpt-4-0125-preview', 'gpt-4-turbo', 'gpt-3.5-turbo']
-const VISION_MODEL_OPTIONS = ['gpt-4o', 'gpt-4-turbo', 'gpt-4o-mini']
const MAX_LENGTH = {
+ 'gpt-4o-mini': 16384,
'gpt-3.5-turbo': 16385,
'gpt-4': 8192,
- 'gpt-4-turbo': 128000,
- 'gpt-4-turbo-preview': 128000,
- 'gpt-4-1106-preview': 128000,
- 'gpt-4-0125-preview': 128000,
- 'gpt-4o': 128000,
- 'gpt-4o-mini': 128000,
+ 'gpt-4-turbo': 4096,
+ 'gpt-4o': 16384,
+ 'o1': 100000,
+ 'o1-mini': 65536,
+ 'o3-mini': 100000,
}
+const MODEL_OPTIONS = Object.keys(MAX_LENGTH);
export default function OpenAI(props: LLmPropsOpenAI) {
@@ -29,27 +29,24 @@ export default function OpenAI(props: LLmPropsOpenAI) {
}, [props.llmConfig.model])
useEffect(() => {
- if (props.isVision) {
- if (props.llmConfig.model && !VISION_MODEL_OPTIONS.includes(props.llmConfig.model)) {
- props.setLlmConfig({ ...props.llmConfig, model: VISION_MODEL_OPTIONS[0] })
- }
- } else {
- if (props.llmConfig.model && !MODEL_OPTIONS.includes(props.llmConfig.model)) {
- props.setLlmConfig({ ...props.llmConfig, model: MODEL_OPTIONS[0] })
- }
+ if (props.llmConfig.model && !MODEL_OPTIONS.includes(props.llmConfig.model)) {
+ props.setLlmConfig({ ...props.llmConfig, model: MODEL_OPTIONS[0] })
}
}, [])
-
return (
props.setLlmConfig({ ...props.llmConfig, model: option })}
disabled={props.disabled}
/>
+
{props.onlyEssential ? null : <>
diff --git a/src/components/projects/projectId/attributes/attributeId/LLM/models/OpenAIoSeriesSwitch.tsx b/src/components/projects/projectId/attributes/attributeId/LLM/models/OpenAIoSeriesSwitch.tsx
new file mode 100644
index 00000000..f0638e02
--- /dev/null
+++ b/src/components/projects/projectId/attributes/attributeId/LLM/models/OpenAIoSeriesSwitch.tsx
@@ -0,0 +1,34 @@
+import { combineClassNames } from "@/submodules/javascript-functions/general"
+import { InfoButton } from "@/submodules/react-components/components/InfoButton"
+import { Switch } from "@headlessui/react"
+import { OpenAIoSeriesSwitchProps } from "../types"
+
+
+export default function OpenAIoSeriesSwitch(props: OpenAIoSeriesSwitchProps) {
+ return
+
+
+
+ o model series
+
+
+
+ props.setLlmConfig({ ...props.llmConfig, openAioSeries: value })}
+ className={combineClassNames(
+ props.llmConfig.openAioSeries ? 'bg-blue-600' : 'bg-gray-200',
+ 'relative inline-flex h-4 w-7 flex-shrink-0 cursor-pointer rounded-full border-2 border-transparent transition-colors duration-200 ease-in-out focus:outline-none focus:ring-2 focus:ring-bg-blue-600 focus:ring-offset-2')}
+ >
+
+
+
+
+
+}
\ No newline at end of file
diff --git a/src/components/projects/projectId/attributes/attributeId/LLM/types.ts b/src/components/projects/projectId/attributes/attributeId/LLM/types.ts
index 32be6b25..40946d37 100644
--- a/src/components/projects/projectId/attributes/attributeId/LLM/types.ts
+++ b/src/components/projects/projectId/attributes/attributeId/LLM/types.ts
@@ -18,7 +18,6 @@ export type LLMConfigProps = {
setLlmConfig: (llmConfig: any) => void,
onlyEssential?: boolean,
projectId?: string,
- isVision?: boolean,
disabled?: boolean,
}
@@ -28,7 +27,6 @@ export type LLmPropsOpenAI = {
setLlmConfig: (llmConfig: any) => void;
onlyEssential?: boolean;
projectId?: string;
- isVision?: boolean;
disabled?: boolean;
}
@@ -40,4 +38,9 @@ export type LLmPropsAzure = {
projectId?: string;
disabled?: boolean;
}
-export type LLmPropsAzureFoundry = LLmPropsAzure;
\ No newline at end of file
+export type LLmPropsAzureFoundry = LLmPropsAzure;
+
+export type OpenAIoSeriesSwitchProps = {
+ llmConfig: any;
+ setLlmConfig: (llmConfig: any) => void;
+}
diff --git a/src/types/components/projects/projectId/settings/data-schema.ts b/src/types/components/projects/projectId/settings/data-schema.ts
index f256de3c..ad23a31d 100644
--- a/src/types/components/projects/projectId/settings/data-schema.ts
+++ b/src/types/components/projects/projectId/settings/data-schema.ts
@@ -18,6 +18,7 @@ export type LLMConfig = {
apiKey: string;
apiVersion?: string, //only for azure
endpoint?: string, //only for azure
+ openAioSeries?: boolean; //only for openai models
}
}
diff --git a/submodules/react-components b/submodules/react-components
index 013f9010..b7583037 160000
--- a/submodules/react-components
+++ b/submodules/react-components
@@ -1 +1 @@
-Subproject commit 013f90102eebd72ddd6f33312da538e640f19ab9
+Subproject commit b7583037d9b1a6dfaacf28afe9ab6cd89ecc3c2d