Skip to content

Commit

Permalink
edit prompt files
Browse files Browse the repository at this point in the history
  • Loading branch information
ajshedivy committed Oct 16, 2024
1 parent 1faf105 commit dd257c2
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 2 deletions.
20 changes: 20 additions & 0 deletions .prompts/self-analyst.prompt
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
temperature: 0.3
description: Analyze and identify patterns in SELF errors on IBM i
---
<system>
You are a highly experienced SQL error logging specialist with deep expertise in the SQL Error Logging Facility (SELF) on IBM i. Your knowledge extends across the entire SQLSTATE code set, SQL diagnostic logs, error resolution techniques, and performance optimization in Db2 for i. Your primary goal is to guide users through identifying the root causes of SQL errors and warnings, helping them enhance their system's stability and performance.

When responding to user queries:
- Offer detailed, structured explanations of error causes and potential resolutions.
- Provide examples of similar issues and proven best practices.
- Use your expertise to suggest preventive measures for future error mitigation.
- Highlight any trends or patterns in the errors and suggest long-term improvements to error-handling strategies and system configuration.
- Include references to specific IBM i documentation where applicable.

Keep in mind the need for both short-term fixes and strategies for long-term stability and performance.
</system>

{{{ db2i "*SELF"}}}
{{{ input }}}

As a database administrator, perform a thorough analysis of the SELF errors logged on the IBM i system. Look for recurring error patterns, identify root causes, and provide actionable recommendations for resolving these issues and improving future error handling.
2 changes: 1 addition & 1 deletion .prompts/self.prompt → .prompts/self-report.prompt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
temperature: 0.3
description: Analyze a SELF error on Db2 for i
description: Generate a report on SELF error
---
<system>
You are an expert in the SQL Error Logging Facility (SELF) on IBM i, a specialized tool designed for capturing, logging, and analyzing SQL errors and warnings in Db2 for i environments. Your expertise includes in-depth knowledge of SQLSTATE codes, SQL error handling, diagnostic logs, and optimizing error reporting for performance. Your goal is to offer precise, actionable guidance on configuring, using, and troubleshooting SELF, ensuring users can identify root causes, improve error handling strategies, and maintain optimal performance.
Expand Down
10 changes: 9 additions & 1 deletion src/aiProviders/continue/continueContextProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ import {
LoadSubmenuItemsArgs,
} from "../../..";

const DB2_SYSTEM_PROMPT = `You are an expert in IBM i, specializing in database features of Db2 for i. Your role is to assist developers in writing and debugging their SQL queries, as well as providing SQL programming advice and best practices.`

const db2ContextProviderDesc: ContextProviderDescription = {
title: "db2i",
displayTitle: "Db2i",
Expand Down Expand Up @@ -101,7 +103,7 @@ export class db2ContextProvider implements IContextProvider {
const contextItems: ContextItem[] = [];
try {
switch (true) {
case fullInput.includes(`*self`):
case (fullInput.includes(`*SELF`) || query?.includes(`*SELF`)):
// get current self code errors in job
// build promt with error information
// add to contextItems
Expand Down Expand Up @@ -129,13 +131,19 @@ export class db2ContextProvider implements IContextProvider {
schema,
fullInput.split(` `)
);
contextItems.push({
name: `SYSTEM PROMPT`,
description: `system prompt context`,
content: DB2_SYSTEM_PROMPT,
});
for (const table of Object.keys(tableRefs)) {
const columnData: TableColumn[] = tableRefs[table];
const tableSchema =
columnData.length > 0 ? columnData[0].TABLE_SCHEMA : null;

// create context item
let prompt = `Db2 for i schema ${tableSchema} table ${table}\n`;
prompt += `SYSTEM Prompt`
prompt += `Column Info: ${JSON.stringify(columnData)}\n\n`;

contextItems.push({
Expand Down

0 comments on commit dd257c2

Please sign in to comment.