Skip to content

Needed to do a little prompt engineering to improve output #17

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 24, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions sql/select-ai-transform-and-summarize.sql
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ select
dbms_cloud_ai.generate (
action => 'chat',
profile_name => '&AI_PROFILE_NAME',
prompt => 'Parse the given address without any comments. '
prompt => 'Parse the given address without any comments. Only return valid JSON - no other text.'
|| 'The result should be 1) a json object for that address and 2) be simple text, not markdown. '
|| 'Here are the required JSON object fields: {addressNumber, streetName, unitNumber, city, state, zip}. '
|| 'Apply to the following address: ' || address
Expand Down Expand Up @@ -76,7 +76,7 @@ SELECT
dbms_cloud_ai.generate (
action => 'chat',
profile_name => '&AI_PROFILE_NAME',
prompt => 'Parse the given address list without any comments. '
prompt => 'Parse the given address list without any comments. Only return valid JSON - no other text.'
|| 'The result should be 1) a json array with an json object for each address and 2) be simple text, not markdown. '
|| 'Here are the required JSON object fields: {addressNumber, streetName, unitNumber, city, state, zip}. '
|| 'Apply to the following list of address: ' || addresses
Expand Down Expand Up @@ -129,7 +129,7 @@ select
dbms_cloud_ai.generate (
action => 'chat',
profile_name => '&AI_PROFILE_NAME',
prompt => 'Summarize the support chat into the following json values without any comments: {summary, keyPhrases, sentiment, supportRep}. content: '
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: '
|| 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. '
|| 'Apply these rules to determine the values: '
|| 'supportRep: the name of the customer service representative, '
Expand Down