diff --git a/front/lib/api/assistant/global_agents.ts b/front/lib/api/assistant/global_agents.ts index 918d175e5281..678e45afdbdf 100644 --- a/front/lib/api/assistant/global_agents.ts +++ b/front/lib/api/assistant/global_agents.ts @@ -10,6 +10,7 @@ import { CLAUDE_INSTANT_DEFAULT_MODEL_CONFIG, GPT_3_5_TURBO_MODEL_CONFIG, GPT_4_TURBO_MODEL_CONFIG, + MISTRAL_MEDIUM_MODEL_CONFIG, MISTRAL_SMALL_MODEL_CONFIG, } from "@dust-tt/types"; import { AgentConfigurationType, GlobalAgentStatus } from "@dust-tt/types"; @@ -240,6 +241,42 @@ async function _getClaudeGlobalAgent({ }; } +async function _getMistralMediumGlobalAgent({ + plan, + settings, +}: { + plan: PlanType; + settings: GlobalAgentSettings | null; +}): Promise { + let status = settings?.status ?? "disabled_by_admin"; + if (plan.code === FREE_TEST_PLAN_CODE) { + status = "disabled_free_workspace"; + } + + return { + id: -1, + sId: GLOBAL_AGENTS_SID.MISTRAL_MEDIUM, + version: 0, + versionAuthorId: null, + name: "mistral-medium", + description: "Mistral latest larger model (8x7B Instruct, 32k context).", + pictureUrl: "https://dust.tt/static/systemavatar/mistral_avatar_full.png", + status, + scope: "global", + userListStatus: status === "active" ? "in-list" : "not-in-list", + generation: { + id: -1, + prompt: "", + model: { + providerId: MISTRAL_MEDIUM_MODEL_CONFIG.providerId, + modelId: MISTRAL_MEDIUM_MODEL_CONFIG.modelId, + }, + temperature: 0.7, + }, + action: null, + }; +} + async function _getMistralSmallGlobalAgent({ settings, }: { @@ -642,6 +679,12 @@ export async function getGlobalAgent( case GLOBAL_AGENTS_SID.CLAUDE: agentConfiguration = await _getClaudeGlobalAgent({ settings, plan }); break; + case GLOBAL_AGENTS_SID.MISTRAL_MEDIUM: + agentConfiguration = await _getMistralMediumGlobalAgent({ + plan, + settings, + }); + break; case GLOBAL_AGENTS_SID.MISTRAL_SMALL: agentConfiguration = await _getMistralSmallGlobalAgent({ settings }); break; diff --git a/front/lib/assistant.ts b/front/lib/assistant.ts index a95ed04c021a..efdf82b0bf6a 100644 --- a/front/lib/assistant.ts +++ b/front/lib/assistant.ts @@ -39,6 +39,7 @@ export enum GLOBAL_AGENTS_SID { GPT35_TURBO = "gpt-3.5-turbo", CLAUDE = "claude-2", CLAUDE_INSTANT = "claude-instant-1", + MISTRAL_MEDIUM = "mistral-medium", //!\ TEMPORARY WORKAROUND: Renaming 'mistral' to 'mistral-small' is not feasible since // it interferes with the retrieval of ongoing conversations involving this agent. // Needed to preserve ongoing chat integrity due to 'sId=mistral' references in legacy messages. @@ -55,6 +56,7 @@ const CUSTOM_ORDER: string[] = [ GLOBAL_AGENTS_SID.GPT35_TURBO, GLOBAL_AGENTS_SID.CLAUDE, GLOBAL_AGENTS_SID.CLAUDE_INSTANT, + GLOBAL_AGENTS_SID.MISTRAL_MEDIUM, GLOBAL_AGENTS_SID.MISTRAL_SMALL, GLOBAL_AGENTS_SID.HELPER, ]; diff --git a/types/src/front/lib/assistant.ts b/types/src/front/lib/assistant.ts index 568df5003283..55a5c5c63893 100644 --- a/types/src/front/lib/assistant.ts +++ b/types/src/front/lib/assistant.ts @@ -68,6 +68,7 @@ export const CLAUDE_INSTANT_DEFAULT_MODEL_CONFIG = { } as const; export const MISTRAL_7B_INSTRUCT_MODEL_ID = "mistral_7B_instruct" as const; +export const MISTRAL_MEDIUM_MODEL_ID = "mistral-medium" as const; export const MISTRAL_SMALL_MODEL_ID = "mistral-small" as const; export const MISTRAL_7B_DEFAULT_MODEL_CONFIG = { @@ -79,6 +80,15 @@ export const MISTRAL_7B_DEFAULT_MODEL_CONFIG = { largeModel: false, } as const; +export const MISTRAL_MEDIUM_MODEL_CONFIG = { + providerId: "mistral", + modelId: MISTRAL_MEDIUM_MODEL_ID, + displayName: "Mistral Medium", + contextSize: 31500, + recommendedTopK: 16, + largeModel: true, +} as const; + export const MISTRAL_SMALL_MODEL_CONFIG = { providerId: "mistral", modelId: MISTRAL_SMALL_MODEL_ID, @@ -105,6 +115,7 @@ export const SUPPORTED_MODEL_CONFIGS = [ CLAUDE_DEFAULT_MODEL_CONFIG, CLAUDE_INSTANT_DEFAULT_MODEL_CONFIG, MISTRAL_7B_DEFAULT_MODEL_CONFIG, + MISTRAL_MEDIUM_MODEL_CONFIG, MISTRAL_SMALL_MODEL_CONFIG, GEMINI_PRO_DEFAULT_MODEL_CONFIG, ] as const;