diff --git a/frontend/src/pages/WorkspaceSettings/AgentConfig/AgentModelSelection/index.jsx b/frontend/src/pages/WorkspaceSettings/AgentConfig/AgentModelSelection/index.jsx index 085f4ef93a6..c6ec0ca22bf 100644 --- a/frontend/src/pages/WorkspaceSettings/AgentConfig/AgentModelSelection/index.jsx +++ b/frontend/src/pages/WorkspaceSettings/AgentConfig/AgentModelSelection/index.jsx @@ -2,6 +2,20 @@ import useGetProviderModels, { DISABLED_PROVIDERS, } from "@/hooks/useGetProvidersModels"; +// These models do NOT support function calling +function supportedModel(provider, model = "") { + if (provider !== "openai") return true; + if (model.startsWith("gpt-3.5-turbo")) return true; + switch (model) { + case "gpt-4": + case "gpt-4-turbo-preview": + case "gpt-4-32k": + return true; + default: + return false; + } +} + export default function AgentModelSelection({ provider, workspace, @@ -60,6 +74,7 @@ export default function AgentModelSelection({ {defaultModels.length > 0 && ( {defaultModels.map((model) => { + if (!supportedModel(provider, model)) return null; return ( {customModels.map((model) => { + if (!supportedModel(provider, model.id)) return null; + return ( - {models.map((model) => ( - - ))} + {models.map((model) => { + if (!supportedModel(provider, model.id)) return null; + return ( + + ); + })} ))} diff --git a/frontend/src/pages/WorkspaceSettings/AgentConfig/index.jsx b/frontend/src/pages/WorkspaceSettings/AgentConfig/index.jsx index 562c40fc1d9..c5ba61f273a 100644 --- a/frontend/src/pages/WorkspaceSettings/AgentConfig/index.jsx +++ b/frontend/src/pages/WorkspaceSettings/AgentConfig/index.jsx @@ -112,92 +112,92 @@ export default function WorkspaceAgentConfiguration({ workspace }) { ); +} - function LoadingSkeleton() { - return ( -
-
- -
- -
+function LoadingSkeleton() { + return ( +
+
+ +
+
- ); - } +
+ ); +} - function AvailableAgentSkills({ skills, settings, toggleAgentSkill }) { - return ( -
-
-
- -
-

- Improve the natural abilities of the default agent with these - pre-built skills. This set up applies to all workspaces. -

+function AvailableAgentSkills({ skills, settings, toggleAgentSkill }) { + return ( +
+
+
+
- + Improve the natural abilities of the default agent with these + pre-built skills. This set up applies to all workspaces. +

+
+ +
+ + + + + -
- - - - - -
- ); - } +
+ ); } diff --git a/server/package.json b/server/package.json index a4a84750921..d4587eb208a 100644 --- a/server/package.json +++ b/server/package.json @@ -53,7 +53,7 @@ "node-html-markdown": "^1.3.0", "node-llama-cpp": "^2.8.0", "openai": "^3.2.1", - "openai:latest": "npm:openai@latest", + "openai-latest": "npm:openai@latest", "pinecone-client": "^1.1.0", "pluralize": "^8.0.0", "posthog-node": "^3.1.1", @@ -84,4 +84,4 @@ "nodemon": "^2.0.22", "prettier": "^3.0.3" } -} +} \ No newline at end of file diff --git a/server/utils/agents/aibitat/providers/openai.js b/server/utils/agents/aibitat/providers/openai.js index 4458afe8ff9..e06dd31d1ac 100644 --- a/server/utils/agents/aibitat/providers/openai.js +++ b/server/utils/agents/aibitat/providers/openai.js @@ -1,4 +1,4 @@ -const OpenAI = require("openai:latest"); +const OpenAI = require("openai-latest"); const Provider = require("./ai-provider.js"); const { RetryError } = require("../error.js"); diff --git a/server/yarn.lock b/server/yarn.lock index 51dda19f794..466ac156033 100644 --- a/server/yarn.lock +++ b/server/yarn.lock @@ -4495,10 +4495,10 @@ onnxruntime-web@1.14.0: onnxruntime-common "~1.14.0" platform "^1.3.6" -"openai:latest@npm:openai@latest": - version "4.32.1" - resolved "https://registry.yarnpkg.com/openai/-/openai-4.32.1.tgz#9e375fdbc727330c5ea5d287beb325db3e6f9ad7" - integrity sha512-3e9QyCY47tgOkxBe2CSVKlXOE2lLkMa24Y0s3LYZR40yYjiBU9dtVze+C3mu1TwWDGiRX52STpQAEJZvRNuIrA== +"openai-latest@npm:openai@latest": + version "4.38.0" + resolved "https://registry.yarnpkg.com/openai/-/openai-4.38.0.tgz#d97accc7c368670a40c2f668650b624cb941dc8b" + integrity sha512-q1w04cRm+7CgUAGDXqt+OMa89zXBffHrEK0FcVDRhD+zL1S1aAatu4iYO5sIxR2QFEP//i8CM3QaxGVTNajxuw== dependencies: "@types/node" "^18.11.18" "@types/node-fetch" "^2.6.4"