Skip to content

Commit dd257c2

Browse files
committed
edit prompt files
1 parent 1faf105 commit dd257c2

File tree

3 files changed

+30
-2
lines changed

3 files changed

+30
-2
lines changed

.prompts/self-analyst.prompt

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
temperature: 0.3
2+
description: Analyze and identify patterns in SELF errors on IBM i
3+
---
4+
<system>
5+
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.
6+
7+
When responding to user queries:
8+
- Offer detailed, structured explanations of error causes and potential resolutions.
9+
- Provide examples of similar issues and proven best practices.
10+
- Use your expertise to suggest preventive measures for future error mitigation.
11+
- Highlight any trends or patterns in the errors and suggest long-term improvements to error-handling strategies and system configuration.
12+
- Include references to specific IBM i documentation where applicable.
13+
14+
Keep in mind the need for both short-term fixes and strategies for long-term stability and performance.
15+
</system>
16+
17+
{{{ db2i "*SELF"}}}
18+
{{{ input }}}
19+
20+
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.

.prompts/self.prompt renamed to .prompts/self-report.prompt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
temperature: 0.3
2-
description: Analyze a SELF error on Db2 for i
2+
description: Generate a report on SELF error
33
---
44
<system>
55
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.

src/aiProviders/continue/continueContextProvider.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ import {
1212
LoadSubmenuItemsArgs,
1313
} from "../../..";
1414

15+
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.`
16+
1517
const db2ContextProviderDesc: ContextProviderDescription = {
1618
title: "db2i",
1719
displayTitle: "Db2i",
@@ -101,7 +103,7 @@ export class db2ContextProvider implements IContextProvider {
101103
const contextItems: ContextItem[] = [];
102104
try {
103105
switch (true) {
104-
case fullInput.includes(`*self`):
106+
case (fullInput.includes(`*SELF`) || query?.includes(`*SELF`)):
105107
// get current self code errors in job
106108
// build promt with error information
107109
// add to contextItems
@@ -129,13 +131,19 @@ export class db2ContextProvider implements IContextProvider {
129131
schema,
130132
fullInput.split(` `)
131133
);
134+
contextItems.push({
135+
name: `SYSTEM PROMPT`,
136+
description: `system prompt context`,
137+
content: DB2_SYSTEM_PROMPT,
138+
});
132139
for (const table of Object.keys(tableRefs)) {
133140
const columnData: TableColumn[] = tableRefs[table];
134141
const tableSchema =
135142
columnData.length > 0 ? columnData[0].TABLE_SCHEMA : null;
136143

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

141149
contextItems.push({

0 commit comments

Comments
 (0)