mirror of
https://github.com/supabase/supabase.git
synced 2026-10-16 06:39:09 +03:00
prompt updates
This commit is contained in:
1 parent
d721d2b962
commit
a2e822d4ec
4 files changed
+12
-8
No files matched your search
+1
-1
@@ -117,7 +117,7 @@ const PolicyTableRowHeader = ({
|
||||
onClick={() => {
|
||||
setAiAssistantPanel({
|
||||
open: true,
|
||||
initialInput: `Create a new policy for the ${table.schema} schema on the ${table.name} table that ...`,
|
||||
initialInput: `Create and name a new policy for the ${table.schema} schema on the ${table.name} table that ...`,
|
||||
})
|
||||
}}
|
||||
tooltip={{
|
||||
|
||||
@@ -97,7 +97,7 @@ export default async function handler(req: NextApiRequest, res: NextApiResponse)
|
||||
|
||||
# You write row level security policies.
|
||||
|
||||
Your purpose is to generate a policy with the constraints given by the user.
|
||||
Your purpose is to generate a policy with the constraints given by the user using the getRlsKnowledge tool.
|
||||
- First, use getSchemaTables to retrieve more information about a schema or schemas that will contain policies, usually the public schema.
|
||||
- Then retrieve existing RLS policies and guidelines on how to write policies using the getRlsKnowledge tool .
|
||||
- Then write new policies or update existing policies based on the prompt
|
||||
@@ -127,10 +127,13 @@ export default async function handler(req: NextApiRequest, res: NextApiResponse)
|
||||
|
||||
Instructions:
|
||||
1. Only modify the selected text based on this prompt: ${prompt}
|
||||
2. Your response should be ONLY the modified selection text, nothing else. Remove selected text if needed.
|
||||
3. Do not wrap in code blocks or markdown
|
||||
4. You can respond with one word or multiple words
|
||||
5. Ensure the modified text flows naturally within the current line
|
||||
2. Get schema tables information using the getSchemaTables tool
|
||||
3. Get existing RLS policies and guidelines on how to write policies using the getRlsKnowledge tool
|
||||
4. Write new policies or update existing policies based on the prompt
|
||||
5. Your response should be ONLY the modified selection text, nothing else. Remove selected text if needed.
|
||||
6. Do not wrap in code blocks or markdown
|
||||
7. You can respond with one word or multiple words
|
||||
8. Ensure the modified text flows naturally within the current line
|
||||
6. Avoid duplicating SQL keywords (SELECT, FROM, WHERE, etc) when considering the full statement
|
||||
7. If there is no surrounding context (before or after), make sure your response is a complete valid SQL statement that can be run and resolves the prompt.
|
||||
|
||||
|
||||
@@ -85,6 +85,7 @@ export const getTools = ({
|
||||
{
|
||||
projectRef,
|
||||
connectionString,
|
||||
schema: schemas[0] || '',
|
||||
},
|
||||
undefined,
|
||||
headers
|
||||
|
||||
@@ -156,7 +156,7 @@ const AuthPoliciesPage: NextPageWithLayout = () => {
|
||||
if (isInlineEditorEnabled) {
|
||||
setEditorPanel({
|
||||
open: true,
|
||||
initialValue: `create policy "policy_name"
|
||||
initialValue: `create policy "replace_with_policy_name"
|
||||
on ${schema}.${table}
|
||||
for select
|
||||
to authenticated
|
||||
@@ -165,7 +165,7 @@ const AuthPoliciesPage: NextPageWithLayout = () => {
|
||||
);`,
|
||||
label: `Create new RLS policy on "${table}"`,
|
||||
saveLabel: 'Create policy',
|
||||
initialPrompt: `Create a new RLS policy for the "${table}" table in the ${schema} schema. The policy should...`,
|
||||
initialPrompt: `Create and name a entirely new RLS policy for the "${table}" table in the ${schema} schema. The policy should...`,
|
||||
})
|
||||
} else {
|
||||
setSelectedTable(table)
|
||||
|
||||
Reference in new issue
Block a user