feat: add Opus/Sonnet model selector to "Genera preventivo" page
Adds a "Modello AI" toggle (Opus default, Sonnet option) styled like the existing Soggetto toggle. The server action validates the keyword and maps it to the real model id; the agent receives the resolved id and uses it in the Anthropic messages.create call. The proposals DB record stores the actual model used. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -11,6 +11,7 @@ type AgentInput = {
|
||||
client?: Pick<Client, "id" | "name" | "brand_name" | "brief">;
|
||||
transcripts: Pick<ClientTranscript, "title" | "content" | "call_date">[];
|
||||
offer: OfferEditorData;
|
||||
model?: string;
|
||||
};
|
||||
|
||||
function buildSystemPrompt(): string {
|
||||
@@ -128,7 +129,7 @@ export async function generateProposalContent(
|
||||
const client = new Anthropic({ apiKey });
|
||||
|
||||
const message = await client.messages.create({
|
||||
model: MODEL,
|
||||
model: input.model ?? MODEL,
|
||||
max_tokens: 8192,
|
||||
system: buildSystemPrompt(),
|
||||
messages: [{ role: "user", content: buildUserPrompt(input) }],
|
||||
|
||||
Reference in New Issue
Block a user