Skip to content

Commit 793f11a

Browse files
authored
Improve ai prompt (#748)
* improve prompt --------- Co-authored-by: Logende <[email protected]>
1 parent 6b5510c commit 793f11a

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

meta_configurator/src/utility/openai.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ export const querySchemaCreation = async (
5454
apiKey: string,
5555
schemaDescriptionNaturalLanguage: string
5656
) => {
57-
const systemMessage = `You are a JSON schema expert. Create a JSON schema based on the schema description by the user. Return no other text than a fully valid JSON schema document.`;
57+
const systemMessage = `You are a JSON schema expert. Create a JSON schema based on the schema description by the user. Return no other text than a fully valid JSON schema document. When appropriate, put sub-schema definitions into the $defs section. `;
5858
return queryOpenAI(apiKey, [
5959
{role: 'system', content: systemMessage},
6060
{role: 'user', content: schemaDescriptionNaturalLanguage},
@@ -66,7 +66,7 @@ export const querySchemaModification = async (
6666
schemaChangeDescriptionNaturalLanguage: string,
6767
fullSchema: string
6868
) => {
69-
const systemMessage = `You are a JSON schema expert. Modify the provided JSON schema based on the schema change description by the user. Return no other text than a fully valid JSON schema document. No other explanation or words. The schema to modify is: \`\`\`${fullSchema}\`\`\``;
69+
const systemMessage = `You are a JSON schema expert. Modify the provided JSON schema based on the schema change description by the user. Return no other text than a fully valid JSON schema document. No other explanation or words. When appropriate, put sub-schema definitions into the $defs section. The schema to modify is: \`\`\`${fullSchema}\`\`\``;
7070
return queryOpenAI(apiKey, [
7171
{role: 'system', content: systemMessage},
7272
{role: 'user', content: schemaChangeDescriptionNaturalLanguage},

0 commit comments

Comments
 (0)