Skip to content

Commit

Permalink
feat: release gemini-pro (custom assistants + global agent (#3006)
Browse files Browse the repository at this point in the history
Co-authored-by: Henry Fontanier <henry@dust.tt>
  • Loading branch information
fontanierh and Henry Fontanier authored Dec 22, 2023
1 parent 84acbca commit 705a1a6
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 1 deletion.
2 changes: 2 additions & 0 deletions front/components/assistant_builder/AssistantBuilder.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import {
AgentConfigurationScope,
ConnectorProvider,
DataSourceType,
GEMINI_PRO_DEFAULT_MODEL_CONFIG,
} from "@dust-tt/types";
import { UserType, WorkspaceType } from "@dust-tt/types";
import {
Expand Down Expand Up @@ -79,6 +80,7 @@ const usedModelConfigs = [
CLAUDE_INSTANT_DEFAULT_MODEL_CONFIG,
MISTRAL_MEDIUM_MODEL_CONFIG,
MISTRAL_SMALL_MODEL_CONFIG,
GEMINI_PRO_DEFAULT_MODEL_CONFIG,
];

// Avatar URLs
Expand Down
40 changes: 39 additions & 1 deletion front/lib/api/assistant/global_agents.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,11 @@ import { promisify } from "util";

const readFileAsync = promisify(fs.readFile);

import { ConnectorProvider, DataSourceType } from "@dust-tt/types";
import {
ConnectorProvider,
DataSourceType,
GEMINI_PRO_DEFAULT_MODEL_CONFIG,
} from "@dust-tt/types";
import {
CLAUDE_DEFAULT_MODEL_CONFIG,
CLAUDE_INSTANT_DEFAULT_MODEL_CONFIG,
Expand Down Expand Up @@ -307,6 +311,37 @@ async function _getMistralSmallGlobalAgent({
};
}

async function _getGeminiProGlobalAgent({
settings,
}: {
settings: GlobalAgentSettings | null;
}): Promise<AgentConfigurationType> {
const status = settings ? settings.status : "disabled_by_admin";
return {
id: -1,
sId: GLOBAL_AGENTS_SID.GEMINI_PRO,
version: 0,
versionAuthorId: null,
name: "gemini-pro",
description:
"Google's our best model for scaling across a wide range of tasks (8k context).",
pictureUrl: "https://dust.tt/static/systemavatar/gemini_avatar_full.png",
status,
scope: "global",
userListStatus: status === "active" ? "in-list" : "not-in-list",
generation: {
id: -1,
prompt: `Never start your messages with "[assistant:"`,
model: {
providerId: GEMINI_PRO_DEFAULT_MODEL_CONFIG.providerId,
modelId: GEMINI_PRO_DEFAULT_MODEL_CONFIG.modelId,
},
temperature: 0.7,
},
action: null,
};
}

async function _getManagedDataSourceAgent(
auth: Authenticator,
{
Expand Down Expand Up @@ -688,6 +723,9 @@ export async function getGlobalAgent(
case GLOBAL_AGENTS_SID.MISTRAL_SMALL:
agentConfiguration = await _getMistralSmallGlobalAgent({ settings });
break;
case GLOBAL_AGENTS_SID.GEMINI_PRO:
agentConfiguration = await _getGeminiProGlobalAgent({ settings });
break;
case GLOBAL_AGENTS_SID.SLACK:
agentConfiguration = await _getSlackGlobalAgent(auth, {
settings,
Expand Down
2 changes: 2 additions & 0 deletions front/lib/assistant.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ export enum GLOBAL_AGENTS_SID {
// 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.
MISTRAL_SMALL = "mistral",
GEMINI_PRO = "gemini-pro",
}

const CUSTOM_ORDER: string[] = [
Expand All @@ -58,6 +59,7 @@ const CUSTOM_ORDER: string[] = [
GLOBAL_AGENTS_SID.CLAUDE_INSTANT,
GLOBAL_AGENTS_SID.MISTRAL_MEDIUM,
GLOBAL_AGENTS_SID.MISTRAL_SMALL,
GLOBAL_AGENTS_SID.GEMINI_PRO,
GLOBAL_AGENTS_SID.HELPER,
];

Expand Down

0 comments on commit 705a1a6

Please sign in to comment.