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 1 commit
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
17 changes: 14 additions & 3 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 All @@ -228,7 +239,7 @@ function _getGPT4GlobalAgent({
description: GPT_4O_MODEL_CONFIG.description,
instructions: null,
pictureUrl: "https://dust.tt/static/systemavatar/gpt4_avatar_full.png",
status,
status: status,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

keep :

Suggested change
status: status,
status,

?

scope: "global",
userListStatus: status === "active" ? "in-list" : "not-in-list",
model: {
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