fix: cooking assistant not reliably calling createRecipe tool

The system prompt only said "you can propose creating a recipe with
the tool" as a soft option — models were defaulting to just writing
the recipe out as prose in the reply instead of invoking the tool,
since that's the easier default behavior for a "write me a recipe"
request. Rewrote the instruction as a hard rule: full recipes must
go through createRecipe, plain-text ingredient lists/numbered steps
are disallowed in the reply for that case.

v0.46.1
This commit is contained in:
Arnaud
2026-07-17 19:02:18 +02:00
parent 9eecdbac3c
commit 458b5f2b07
5 changed files with 16 additions and 4 deletions
+5
View File
@@ -2,6 +2,11 @@
All notable changes to Epicure are documented here. This file is mirrored in-app at `/changelog` (and in the admin dashboard) via `apps/web/lib/changelog.ts` — update both together.
## 0.46.1 — 2026-07-17 19:05
### Fixed
- Asking the cooking assistant to create a recipe would often just get you the recipe typed out in the chat instead of the createRecipe draft card — the instruction telling the model to use the tool was a soft suggestion, not a hard rule. Made it explicit: full recipes must go through the tool, never as plain-text ingredients/steps in the reply.
## 0.46.0 — 2026-07-17 18:00
### Added
+1 -1
View File
@@ -45,7 +45,7 @@ export async function POST(req: NextRequest) {
const result = await withAiQuota(session!.user.id, session!.user.tier as "free" | "pro" | "team", () =>
generateText({
model,
system: `You are Epicure, a helpful culinary assistant answering general cooking questions — not tied to any specific recipe (techniques, substitutions, timing, equipment, food safety, etc). If asked who you are or what model/AI you're built on, say you're Epicure — never name the underlying model or provider. If a question has nothing to do with cooking or food, politely redirect. Keep answers under 200 words. Respond in ${lang}.\n\nYou have two tools, both of which only draft something for the user to review — neither saves anything by itself, so still write a short text reply too when you use one (e.g. "Here's a draft — check it below and confirm if it looks right").\n- createRecipe: only when the user explicitly asks you to create, save, or write down a recipe (e.g. "make me a recipe for X", "write that down as a recipe"). Don't call it just because a recipe came up in conversation.\n- addToShoppingList: only when the user explicitly asks to add ingredients/items to a shopping list (e.g. "add that to my shopping list").${bioContext}`,
system: `You are Epicure, a helpful culinary assistant answering general cooking questions — not tied to any specific recipe (techniques, substitutions, timing, equipment, food safety, etc). If asked who you are or what model/AI you're built on, say you're Epicure — never name the underlying model or provider. If a question has nothing to do with cooking or food, politely redirect. Keep answers under 200 words. Respond in ${lang}.\n\nYou have two tools. Using one only drafts something for the user to review — it never saves by itself.\n- createRecipe: the user is asking you to create, save, or write down a recipe (e.g. "make me a recipe for X", "give me a recipe for Y", "write that down"). This includes any request for a full recipe, not only ones that say the word "create" or "save".\n- addToShoppingList: the user is asking to add ingredients/items to a shopping list.\n\nIMPORTANT: when the user's request matches createRecipe, you MUST call that tool instead of writing the recipe's ingredients or steps directly in your text reply. Never output a full ingredient list or numbered steps as plain text — that content belongs in the tool call, not the message. Your text reply in that case should just be a short line like "Here's a draft — check it below and confirm if it looks right." Only skip the tool if the user is asking a general question (no specific recipe requested) or explicitly wants prose, not a structured recipe.${bioContext}`,
prompt: parsed.data.question,
tools: { createRecipe: createRecipeTool, addToShoppingList: addToShoppingListTool },
stopWhen: stepCountIs(3),
+8 -1
View File
@@ -1,5 +1,5 @@
// Mirrors CHANGELOG.md at the repo root — update both together.
export const APP_VERSION = "0.46.0";
export const APP_VERSION = "0.46.1";
export type ChangelogEntry = {
version: string;
@@ -11,6 +11,13 @@ export type ChangelogEntry = {
};
export const CHANGELOG: ChangelogEntry[] = [
{
version: "0.46.1",
date: "2026-07-17 19:05",
fixed: [
"Asking the cooking assistant to create a recipe would often just get you the recipe typed out in the chat instead of the createRecipe draft card — the instruction telling the model to use the tool was a soft suggestion, not a hard rule. Made it explicit: full recipes must go through the tool, never as plain-text ingredients/steps in the reply.",
],
},
{
version: "0.46.0",
date: "2026-07-17 18:00",
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@epicure/web",
"version": "0.46.0",
"version": "0.46.1",
"private": true,
"scripts": {
"dev": "next dev",
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "epicure",
"version": "0.46.0",
"version": "0.46.1",
"private": true,
"scripts": {
"dev": "pnpm --filter web dev",