Skip to content

Commit

Permalink
Lucas/1190 polishing viz (#8651)
Browse files Browse the repository at this point in the history
* Viz enabled by default for new assistants. Raw models can use Viz and WebSearch

* Avoid triggering search on common knowledge questions

* Claude now using search appropriately for basic factual questions, instructions in meta tool prompt

* Instructions narrowed down to search tool

* Rolling back claude search capability until I do further QA

---------

Co-authored-by: Lucas <[email protected]>
  • Loading branch information
overmode and Lucas authored Nov 14, 2024
1 parent 16d5269 commit 2e3c53b
Show file tree
Hide file tree
Showing 15 changed files with 27 additions and 48 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,9 @@ import type {
} from "@app/components/assistant_builder/types";
import {
DEFAULT_BROWSE_ACTION_NAME,
DEFAULT_WEBSEARCH_ACTION_DESCRIPTION,
DEFAULT_WEBSEARCH_ACTION_NAME,
} from "@app/lib/api/assistant/actions/names";
} from "@app/lib/api/assistant/actions/constants";

type SlackChannelLinkedWithAgent = SlackChannel & {
agentConfigurationId: string;
Expand Down Expand Up @@ -153,7 +154,7 @@ export async function submitAssistantBuilderForm({
{
type: "websearch_configuration",
name: DEFAULT_WEBSEARCH_ACTION_NAME,
description: "Perform a web search",
description: DEFAULT_WEBSEARCH_ACTION_DESCRIPTION,
},
{
type: "browse_configuration",
Expand Down
2 changes: 1 addition & 1 deletion front/components/assistant_builder/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import {
DEFAULT_RETRIEVAL_NO_QUERY_ACTION_NAME,
DEFAULT_TABLES_QUERY_ACTION_NAME,
DEFAULT_WEBSEARCH_ACTION_NAME,
} from "@app/lib/api/assistant/actions/names";
} from "@app/lib/api/assistant/actions/constants";
import type { FetchAssistantTemplateResponse } from "@app/pages/api/w/[wId]/assistant/builder/templates/[tId]";

export const ACTION_MODES = [
Expand Down
2 changes: 1 addition & 1 deletion front/lib/api/assistant/actions/browse.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import { BaseAction, BrowseActionOutputSchema, Ok } from "@dust-tt/types";
import { isLeft } from "fp-ts/lib/Either";

import { runActionStreamed } from "@app/lib/actions/server";
import { DEFAULT_BROWSE_ACTION_NAME } from "@app/lib/api/assistant/actions/names";
import { DEFAULT_BROWSE_ACTION_NAME } from "@app/lib/api/assistant/actions/constants";
import type { BaseActionRunParams } from "@app/lib/api/assistant/actions/types";
import { BaseActionConfigurationServerRunner } from "@app/lib/api/assistant/actions/types";
import type { Authenticator } from "@app/lib/auth";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,6 @@ export const DEFAULT_RETRIEVAL_ACTION_NAME = "search_data_sources";
export const DEFAULT_RETRIEVAL_NO_QUERY_ACTION_NAME =
"most_recent_in_data_sources";
export const DEFAULT_WEBSEARCH_ACTION_NAME = "web_search";
export const DEFAULT_WEBSEARCH_ACTION_DESCRIPTION = "Perform a web search";
export const DEFAULT_TABLES_QUERY_ACTION_NAME = "query_tables";
export const DEFAULT_VISUALIZATION_ACTION_NAME = "visualization";
2 changes: 1 addition & 1 deletion front/lib/api/assistant/actions/process.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import assert from "assert";
import _ from "lodash";

import { runActionStreamed } from "@app/lib/actions/server";
import { DEFAULT_PROCESS_ACTION_NAME } from "@app/lib/api/assistant/actions/names";
import { DEFAULT_PROCESS_ACTION_NAME } from "@app/lib/api/assistant/actions/constants";
import {
parseTimeFrame,
retrievalAutoTimeFrameInputSpecification,
Expand Down
2 changes: 1 addition & 1 deletion front/lib/api/assistant/actions/retrieval.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import assert from "assert";
import _ from "lodash";

import { runActionStreamed } from "@app/lib/actions/server";
import { DEFAULT_RETRIEVAL_ACTION_NAME } from "@app/lib/api/assistant/actions/names";
import { DEFAULT_RETRIEVAL_ACTION_NAME } from "@app/lib/api/assistant/actions/constants";
import type { BaseActionRunParams } from "@app/lib/api/assistant/actions/types";
import { BaseActionConfigurationServerRunner } from "@app/lib/api/assistant/actions/types";
import {
Expand Down
2 changes: 1 addition & 1 deletion front/lib/api/assistant/actions/tables_query.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import {
import { stringify } from "csv-stringify";

import { runActionStreamed } from "@app/lib/actions/server";
import { DEFAULT_TABLES_QUERY_ACTION_NAME } from "@app/lib/api/assistant/actions/names";
import { DEFAULT_TABLES_QUERY_ACTION_NAME } from "@app/lib/api/assistant/actions/constants";
import type { BaseActionRunParams } from "@app/lib/api/assistant/actions/types";
import { BaseActionConfigurationServerRunner } from "@app/lib/api/assistant/actions/types";
import { renderConversationForModel } from "@app/lib/api/assistant/generation";
Expand Down
2 changes: 1 addition & 1 deletion front/lib/api/assistant/actions/websearch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import { BaseAction, Ok, WebsearchAppActionOutputSchema } from "@dust-tt/types";
import { isLeft } from "fp-ts/lib/Either";

import { runActionStreamed } from "@app/lib/actions/server";
import { DEFAULT_WEBSEARCH_ACTION_NAME } from "@app/lib/api/assistant/actions/names";
import { DEFAULT_WEBSEARCH_ACTION_NAME } from "@app/lib/api/assistant/actions/constants";
import type { BaseActionRunParams } from "@app/lib/api/assistant/actions/types";
import { BaseActionConfigurationServerRunner } from "@app/lib/api/assistant/actions/types";
import {
Expand Down
2 changes: 1 addition & 1 deletion front/lib/api/assistant/configuration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ import {
DEFAULT_RETRIEVAL_ACTION_NAME,
DEFAULT_TABLES_QUERY_ACTION_NAME,
DEFAULT_WEBSEARCH_ACTION_NAME,
} from "@app/lib/api/assistant/actions/names";
} from "@app/lib/api/assistant/actions/constants";
import { fetchBrowseActionConfigurations } from "@app/lib/api/assistant/configuration/browse";
import { fetchDustAppRunActionConfigurations } from "@app/lib/api/assistant/configuration/dust_app_run";
import { fetchAgentProcessActionConfigurations } from "@app/lib/api/assistant/configuration/process";
Expand Down
2 changes: 1 addition & 1 deletion front/lib/api/assistant/configuration/browse.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { BrowseConfigurationType, ModelId } from "@dust-tt/types";
import { Op } from "sequelize";

import { DEFAULT_BROWSE_ACTION_NAME } from "@app/lib/api/assistant/actions/names";
import { DEFAULT_BROWSE_ACTION_NAME } from "@app/lib/api/assistant/actions/constants";
import { AgentBrowseConfiguration } from "@app/lib/models/assistant/actions/browse";

export async function fetchBrowseActionConfigurations({
Expand Down
2 changes: 1 addition & 1 deletion front/lib/api/assistant/configuration/process.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import type {
import _ from "lodash";
import { Op } from "sequelize";

import { DEFAULT_PROCESS_ACTION_NAME } from "@app/lib/api/assistant/actions/names";
import { DEFAULT_PROCESS_ACTION_NAME } from "@app/lib/api/assistant/actions/constants";
import { renderRetrievalTimeframeType } from "@app/lib/api/assistant/configuration/helpers";
import { AgentDataSourceConfiguration } from "@app/lib/models/assistant/actions/data_sources";
import { AgentProcessConfiguration } from "@app/lib/models/assistant/actions/process";
Expand Down
2 changes: 1 addition & 1 deletion front/lib/api/assistant/configuration/retrieval.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import type {
import _ from "lodash";
import { Op } from "sequelize";

import { DEFAULT_RETRIEVAL_ACTION_NAME } from "@app/lib/api/assistant/actions/names";
import { DEFAULT_RETRIEVAL_ACTION_NAME } from "@app/lib/api/assistant/actions/constants";
import { renderRetrievalTimeframeType } from "@app/lib/api/assistant/configuration/helpers";
import { AgentDataSourceConfiguration } from "@app/lib/models/assistant/actions/data_sources";
import { AgentRetrievalConfiguration } from "@app/lib/models/assistant/actions/retrieval";
Expand Down
2 changes: 1 addition & 1 deletion front/lib/api/assistant/configuration/table_query.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import _ from "lodash";
import type { Transaction } from "sequelize";
import { Op } from "sequelize";

import { DEFAULT_TABLES_QUERY_ACTION_NAME } from "@app/lib/api/assistant/actions/names";
import { DEFAULT_TABLES_QUERY_ACTION_NAME } from "@app/lib/api/assistant/actions/constants";
import type { Authenticator } from "@app/lib/auth";
import {
AgentTablesQueryConfiguration,
Expand Down
2 changes: 1 addition & 1 deletion front/lib/api/assistant/configuration/websearch.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { ModelId, WebsearchConfigurationType } from "@dust-tt/types";
import { Op } from "sequelize";

import { DEFAULT_WEBSEARCH_ACTION_NAME } from "@app/lib/api/assistant/actions/names";
import { DEFAULT_WEBSEARCH_ACTION_NAME } from "@app/lib/api/assistant/actions/constants";
import { AgentWebsearchConfiguration } from "@app/lib/models/assistant/actions/websearch";

export async function fetchWebsearchActionConfigurations({
Expand Down
45 changes: 11 additions & 34 deletions front/lib/api/assistant/global_agents.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,9 @@ import assert from "assert";
import {
DEFAULT_BROWSE_ACTION_NAME,
DEFAULT_RETRIEVAL_ACTION_NAME,
DEFAULT_WEBSEARCH_ACTION_DESCRIPTION,
DEFAULT_WEBSEARCH_ACTION_NAME,
} from "@app/lib/api/assistant/actions/names";
} from "@app/lib/api/assistant/actions/constants";
import { getFavoriteStates } from "@app/lib/api/assistant/get_favorite_states";
import type { Authenticator } from "@app/lib/auth";
import { getFeatureFlags } from "@app/lib/auth";
Expand Down Expand Up @@ -133,7 +134,7 @@ function _getDefaultSearchActionForGlobalAgent({
sId: agentSid + "-search-action",
type: "websearch_configuration",
name: DEFAULT_WEBSEARCH_ACTION_NAME,
description: `Perform a web search.`,
description: DEFAULT_WEBSEARCH_ACTION_DESCRIPTION,
};
}

Expand Down Expand Up @@ -337,13 +338,9 @@ function _getO1PreviewGlobalAgent({
modelId: O1_PREVIEW_MODEL_CONFIG.modelId,
temperature: 1, // 1 is forced for O1
},
actions: [
_getDefaultSearchActionForGlobalAgent({
agentSid: GLOBAL_AGENTS_SID.O1,
}),
],
actions: [],
maxStepsPerRun: 3,
visualizationEnabled: true,
visualizationEnabled: false,
templateId: null,
// TODO(2024-11-04 flav) `groupId` clean-up.
groupIds: [],
Expand Down Expand Up @@ -382,7 +379,7 @@ function _getO1MiniGlobalAgent({
},
actions: [],
maxStepsPerRun: 3,
visualizationEnabled: true,
visualizationEnabled: false,
templateId: null,
// TODO(2024-11-04 flav) `groupId` clean-up.
groupIds: [],
Expand Down Expand Up @@ -414,11 +411,7 @@ function _getClaudeInstantGlobalAgent({
modelId: CLAUDE_INSTANT_DEFAULT_MODEL_CONFIG.modelId,
temperature: 0.7,
},
actions: [
_getDefaultSearchActionForGlobalAgent({
agentSid: GLOBAL_AGENTS_SID.CLAUDE_INSTANT,
}),
],
actions: [],
maxStepsPerRun: 3,
visualizationEnabled: true,
templateId: null,
Expand Down Expand Up @@ -459,11 +452,7 @@ function _getClaude2GlobalAgent({
temperature: 0.7,
},

actions: [
_getDefaultSearchActionForGlobalAgent({
agentSid: GLOBAL_AGENTS_SID.CLAUDE_2,
}),
],
actions: [],
maxStepsPerRun: 3,
visualizationEnabled: true,
templateId: null,
Expand Down Expand Up @@ -498,11 +487,7 @@ function _getClaude3HaikuGlobalAgent({
modelId: CLAUDE_3_HAIKU_DEFAULT_MODEL_CONFIG.modelId,
temperature: 0.7,
},
actions: [
_getDefaultSearchActionForGlobalAgent({
agentSid: GLOBAL_AGENTS_SID.CLAUDE_3_HAIKU,
}),
],
actions: [],
maxStepsPerRun: 3,
visualizationEnabled: true,
templateId: null,
Expand Down Expand Up @@ -542,11 +527,7 @@ function _getClaude3OpusGlobalAgent({
modelId: CLAUDE_3_OPUS_DEFAULT_MODEL_CONFIG.modelId,
temperature: 0.7,
},
actions: [
_getDefaultSearchActionForGlobalAgent({
agentSid: GLOBAL_AGENTS_SID.CLAUDE_3_OPUS,
}),
],
actions: [],
maxStepsPerRun: 3,
visualizationEnabled: true,
templateId: null,
Expand Down Expand Up @@ -587,11 +568,7 @@ function _getClaude3GlobalAgent({
temperature: 0.7,
},

actions: [
_getDefaultSearchActionForGlobalAgent({
agentSid: GLOBAL_AGENTS_SID.CLAUDE_3_SONNET,
}),
],
actions: [],
maxStepsPerRun: 3,
visualizationEnabled: true,
templateId: null,
Expand Down

0 comments on commit 2e3c53b

Please sign in to comment.