Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow admins to disable the GPT4 global agent. #6618

Merged
merged 2 commits into from
Aug 1, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 13 additions & 2 deletions front/lib/api/assistant/global_agents.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ const readFileAsync = promisify(fs.readFile);

import type {
AgentActionConfigurationType,
AgentConfigurationStatus,
AgentConfigurationType,
AgentModelConfigurationType,
ConnectorProvider,
Expand Down Expand Up @@ -214,10 +215,20 @@ function _getGPT35TurboGlobalAgent({

function _getGPT4GlobalAgent({
auth,
settings,
}: {
auth: Authenticator;
settings: GlobalAgentSettings | null;
}): AgentConfigurationType {
const status = !auth.isUpgraded() ? "disabled_free_workspace" : "active";
let status: AgentConfigurationStatus = "active";

if (settings) {
status = settings.status;
}
if (!auth.isUpgraded()) {
status = "disabled_free_workspace";
}

return {
id: -1,
sId: GLOBAL_AGENTS_SID.GPT4,
Expand Down Expand Up @@ -1026,7 +1037,7 @@ function getGlobalAgent(
agentConfiguration = _getGPT35TurboGlobalAgent({ settings });
break;
case GLOBAL_AGENTS_SID.GPT4:
agentConfiguration = _getGPT4GlobalAgent({ auth });
agentConfiguration = _getGPT4GlobalAgent({ auth, settings });
break;
case GLOBAL_AGENTS_SID.CLAUDE_INSTANT:
agentConfiguration = _getClaudeInstantGlobalAgent({ settings });
Expand Down
Loading