Skip to content

Commit

Permalink
enh(viz): use claude 3.5 sonnet unless forbidden (#6485)
Browse files Browse the repository at this point in the history
Co-authored-by: Henry Fontanier <[email protected]>
  • Loading branch information
fontanierh and Henry Fontanier committed Jul 25, 2024
1 parent e0992ce commit 83edeb4
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions front/lib/api/assistant/actions/visualization.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,10 @@ import type {
} from "@dust-tt/types";
import {
BaseAction,
CLAUDE_3_5_SONNET_DEFAULT_MODEL_CONFIG,
cloneBaseConfig,
DustProdActionRegistry,
isProviderWhitelisted,
Ok,
VisualizationActionOutputSchema,
} from "@dust-tt/types";
Expand Down Expand Up @@ -245,10 +247,19 @@ export class VisualizationConfigurationServerRunner extends BaseActionConfigurat
const config = cloneBaseConfig(
DustProdActionRegistry["assistant-v2-visualization"].config
);
const model = agentConfiguration.model;

// If we can use Sonnet 3.5, we use it.
// Otherwise, we use the model from the agent configuration.
const model =
auth.isUpgraded() && isProviderWhitelisted(owner, "anthropic")
? CLAUDE_3_5_SONNET_DEFAULT_MODEL_CONFIG
: agentConfiguration.model;

config.MODEL.provider_id = model.providerId;
config.MODEL.model_id = model.modelId;
config.MODEL.temperature = model.temperature;

// Preserve the temperature from the agent configuration.
config.MODEL.temperature = agentConfiguration.model.temperature;

// Execute the Vizualization Dust App.
const visualizationRes = await runActionStreamed(
Expand Down

0 comments on commit 83edeb4

Please sign in to comment.