Improve the AI Assistant user prompt to be more descriptive of the actual functionality.

This commit is contained in:
Dave Page
2026-03-16 12:34:44 +05:30
committed by GitHub
parent 34aa360830
commit 0bc4edbab5
3 changed files with 15 additions and 7 deletions
+1
View File
@@ -34,5 +34,6 @@ Bug fixes
| `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.
| `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.
| `Issue #9721 <https://github.com/pgadmin-org/pgadmin4/issues/9721>`_ - Fixed an issue where permissions page is not completely accessible on full scroll.
| `Issue #9732 <https://github.com/pgadmin-org/pgadmin4/issues/9732>`_ - Improve the AI Assistant user prompt to be more descriptive of the actual functionality.
| `Issue #9738 <https://github.com/pgadmin-org/pgadmin4/issues/9738>`_ - Allow copying of text from the AI Assistant chat panel.
| `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.
@@ -731,8 +731,9 @@ export function NLQChatPanel() {
>
<Typography variant="body2" style={{ color: textColors.secondary }}>
{gettext(
'Describe what SQL you need and I\'ll generate it for you. ' +
'I can help with SELECT, INSERT, UPDATE, DELETE, and DDL statements.'
'Ask a question about your database or describe the SQL you need ' +
'and I\'ll generate it for you. ' +
'I can help with SELECT, INSERT, UPDATE, DELETE, and DDL statements.'
)}
</Typography>
</Box>
@@ -758,7 +759,7 @@ export function NLQChatPanel() {
multiline
minRows={1}
maxRows={4}
placeholder={gettext('Describe the SQL you need...')}
placeholder={gettext('Ask a question or describe the SQL you need...')}
value={inputValue}
onChange={(e) => setInputValue(e.target.value)}
onKeyDown={handleKeyDown}
@@ -116,13 +116,15 @@ describe('NLQChatPanel Component', () => {
it('should show empty state message when no messages', () => {
renderWithContexts(<ThemedNLQChatPanel />);
expect(
screen.getByText(/Describe what SQL you need/i)
screen.getByText(/Describe the SQL you need/i)
).toBeInTheDocument();
});
it('should have input field for typing queries', () => {
renderWithContexts(<ThemedNLQChatPanel />);
const input = screen.getByPlaceholderText(/Describe the SQL you need/i);
const input = screen.getByPlaceholderText(
/Ask a question or describe the SQL you need/i,
);
expect(input).toBeInTheDocument();
});
@@ -146,7 +148,9 @@ describe('NLQChatPanel Component', () => {
it('should enable send button when input has text', () => {
const { container } = renderWithContexts(<ThemedNLQChatPanel />);
const input = screen.getByPlaceholderText(/Describe the SQL you need/i);
const input = screen.getByPlaceholderText(
/Ask a question or describe the SQL you need/i,
);
fireEvent.change(input, { target: { value: 'Find all users' } });
@@ -167,7 +171,9 @@ describe('NLQChatPanel Component', () => {
it('should clear input after typing and clicking clear', () => {
renderWithContexts(<ThemedNLQChatPanel />);
const input = screen.getByPlaceholderText(/Describe the SQL you need/i);
const input = screen.getByPlaceholderText(
/Ask a question or describe the SQL you need/i,
);
fireEvent.change(input, { target: { value: 'Find all users' } });
expect(input.value).toBe('Find all users');