Skip to content

Commit 8375880

Browse files
authored
remove dynamic chat name from prompt for caching (supabase#37281)
1 parent 406b243 commit 8375880

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

apps/studio/pages/api/ai/sql/generate-v4.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,7 @@ async function handlePost(req: NextApiRequest, res: NextApiResponse) {
264264
265265
# Core Principles:
266266
- **Tool Usage Strategy**:
267-
- **Always call \`rename_chat\` before you respond at the start of the conversation** with a 2-4 word descriptive name. Examples: "User Authentication Setup", "Sales Data Analysis", "Product Table Creation"**. Current chat name: ${chatName}
267+
- **Always call \`rename_chat\` before you respond at the start of the conversation** with a 2-4 word descriptive name. Examples: "User Authentication Setup", "Sales Data Analysis", "Product Table Creation"**.
268268
- **Always attempt to use MCP tools** like \`list_tables\` and \`list_extensions\` to gather schema information if available. If these tools are not available or return a privacy message, state that you cannot access schema information and will proceed based on general Postgres/Supabase knowledge.
269269
- For **READ ONLY** queries:
270270
- Explain your plan.
@@ -405,7 +405,7 @@ async function handlePost(req: NextApiRequest, res: NextApiResponse) {
405405
{
406406
role: 'assistant',
407407
// Add any dynamic context here
408-
content: `The user's current project is ${projectRef}. Their available schemas are: ${schemasString}`,
408+
content: `The user's current project is ${projectRef}. Their available schemas are: ${schemasString}. The current chat name is: ${chatName}`,
409409
},
410410
...convertToCoreMessages(messages),
411411
]

0 commit comments

Comments
 (0)