Skip to content

Commit aab1217

Browse files
authored
Merge pull request #17 from martygubar/main
Needed to do a little prompt engineering to improve output
2 parents b1a2600 + 938bba0 commit aab1217

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

sql/select-ai-transform-and-summarize.sql

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ select
2323
dbms_cloud_ai.generate (
2424
action => 'chat',
2525
profile_name => '&AI_PROFILE_NAME',
26-
prompt => 'Parse the given address without any comments. '
26+
prompt => 'Parse the given address without any comments. Only return valid JSON - no other text.'
2727
|| 'The result should be 1) a json object for that address and 2) be simple text, not markdown. '
2828
|| 'Here are the required JSON object fields: {addressNumber, streetName, unitNumber, city, state, zip}. '
2929
|| 'Apply to the following address: ' || address
@@ -76,7 +76,7 @@ SELECT
7676
dbms_cloud_ai.generate (
7777
action => 'chat',
7878
profile_name => '&AI_PROFILE_NAME',
79-
prompt => 'Parse the given address list without any comments. '
79+
prompt => 'Parse the given address list without any comments. Only return valid JSON - no other text.'
8080
|| 'The result should be 1) a json array with an json object for each address and 2) be simple text, not markdown. '
8181
|| 'Here are the required JSON object fields: {addressNumber, streetName, unitNumber, city, state, zip}. '
8282
|| 'Apply to the following list of address: ' || addresses
@@ -129,7 +129,7 @@ select
129129
dbms_cloud_ai.generate (
130130
action => 'chat',
131131
profile_name => '&AI_PROFILE_NAME',
132-
prompt => 'Summarize the support chat into the following json values without any comments: {summary, keyPhrases, sentiment, supportRep}. content: '
132+
prompt => 'Summarize the support chat into the following json values without any comments - only return valid JSON - no other text: {summary, keyPhrases, sentiment, supportRep}. content: '
133133
|| support_chat || '. The result should 1) be a valid json document that can be validated against a json schema, 2) begin with { and end with }, 3) be simple text, not markdown. '
134134
|| 'Apply these rules to determine the values: '
135135
|| 'supportRep: the name of the customer service representative, '

0 commit comments

Comments
 (0)