Skip to content

Commit 0bc4edb

Browse files
authored
Improve the AI Assistant user prompt to be more descriptive of the actual functionality.
1 parent 34aa360 commit 0bc4edb

File tree

3 files changed

+15
-7
lines changed

3 files changed

+15
-7
lines changed

docs/en_US/release_notes_9_14.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,5 +34,6 @@ Bug fixes
3434
| `Issue #9392 <https://github.com/pgadmin-org/pgadmin4/issues/9392>`_ - Ensure that the Geometry Viewer refreshes when re-running queries or switching geometry columns, preventing stale data from being displayed.
3535
| `Issue #9719 <https://github.com/pgadmin-org/pgadmin4/issues/9719>`_ - Fixed an issue where AI Reports fail with OpenAI models that do not support the temperature parameter.
3636
| `Issue #9721 <https://github.com/pgadmin-org/pgadmin4/issues/9721>`_ - Fixed an issue where permissions page is not completely accessible on full scroll.
37+
| `Issue #9732 <https://github.com/pgadmin-org/pgadmin4/issues/9732>`_ - Improve the AI Assistant user prompt to be more descriptive of the actual functionality.
3738
| `Issue #9738 <https://github.com/pgadmin-org/pgadmin4/issues/9738>`_ - Allow copying of text from the AI Assistant chat panel.
3839
| `Issue #9740 <https://github.com/pgadmin-org/pgadmin4/issues/9740>`_ - Fixed an issue where the AI Assistant input textbox sometimes swallows the first character of input.

web/pgadmin/tools/sqleditor/static/js/components/sections/NLQChatPanel.jsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -731,8 +731,9 @@ export function NLQChatPanel() {
731731
>
732732
<Typography variant="body2" style={{ color: textColors.secondary }}>
733733
{gettext(
734-
'Describe what SQL you need and I\'ll generate it for you. ' +
735-
'I can help with SELECT, INSERT, UPDATE, DELETE, and DDL statements.'
734+
'Ask a question about your database or describe the SQL you need ' +
735+
'and I\'ll generate it for you. ' +
736+
'I can help with SELECT, INSERT, UPDATE, DELETE, and DDL statements.'
736737
)}
737738
</Typography>
738739
</Box>
@@ -758,7 +759,7 @@ export function NLQChatPanel() {
758759
multiline
759760
minRows={1}
760761
maxRows={4}
761-
placeholder={gettext('Describe the SQL you need...')}
762+
placeholder={gettext('Ask a question or describe the SQL you need...')}
762763
value={inputValue}
763764
onChange={(e) => setInputValue(e.target.value)}
764765
onKeyDown={handleKeyDown}

web/regression/javascript/sqleditor/NLQChatPanel.spec.js

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -116,13 +116,15 @@ describe('NLQChatPanel Component', () => {
116116
it('should show empty state message when no messages', () => {
117117
renderWithContexts(<ThemedNLQChatPanel />);
118118
expect(
119-
screen.getByText(/Describe what SQL you need/i)
119+
screen.getByText(/Describe the SQL you need/i)
120120
).toBeInTheDocument();
121121
});
122122

123123
it('should have input field for typing queries', () => {
124124
renderWithContexts(<ThemedNLQChatPanel />);
125-
const input = screen.getByPlaceholderText(/Describe the SQL you need/i);
125+
const input = screen.getByPlaceholderText(
126+
/Ask a question or describe the SQL you need/i,
127+
);
126128
expect(input).toBeInTheDocument();
127129
});
128130

@@ -146,7 +148,9 @@ describe('NLQChatPanel Component', () => {
146148

147149
it('should enable send button when input has text', () => {
148150
const { container } = renderWithContexts(<ThemedNLQChatPanel />);
149-
const input = screen.getByPlaceholderText(/Describe the SQL you need/i);
151+
const input = screen.getByPlaceholderText(
152+
/Ask a question or describe the SQL you need/i,
153+
);
150154

151155
fireEvent.change(input, { target: { value: 'Find all users' } });
152156

@@ -167,7 +171,9 @@ describe('NLQChatPanel Component', () => {
167171

168172
it('should clear input after typing and clicking clear', () => {
169173
renderWithContexts(<ThemedNLQChatPanel />);
170-
const input = screen.getByPlaceholderText(/Describe the SQL you need/i);
174+
const input = screen.getByPlaceholderText(
175+
/Ask a question or describe the SQL you need/i,
176+
);
171177

172178
fireEvent.change(input, { target: { value: 'Find all users' } });
173179
expect(input.value).toBe('Find all users');

0 commit comments

Comments
 (0)