Skip to content

Commit

Permalink
Improve llm comment message after SQL generation (#144)
Browse files Browse the repository at this point in the history
  • Loading branch information
aldrinjenson authored Sep 18, 2023
1 parent 21c4ff5 commit 77d586d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
4 changes: 1 addition & 3 deletions src/hooks/usePostLLM.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,12 @@ import { notifications } from '@mantine/notifications';
import { IconCheck, IconFileAlert } from '@tabler/icons-react';
import { postLLM } from '@/api/llm';


// this used to call ai query api
export const usePostLLM = () => {
const [data, setData] = useMountedState<string | null>(null);
const [error, setError] = useMountedState<string | null>(null);
const [loading, setLoading] = useMountedState<boolean>(false);


// this function is used to call ai query api
const postLLMQuery = async (prompt: string, stream: string) => {
try {
Expand All @@ -21,7 +19,7 @@ export const usePostLLM = () => {
loading: true,
color: '#545BEB',
title: 'Generating Query',
message: 'Query will be generating using AI.',
message: 'Generating SQL query using AI.',
autoClose: false,
withCloseButton: false,
});
Expand Down
6 changes: 3 additions & 3 deletions src/pages/Query/QueryCodeEditor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ const QueryCodeEditor: FC = () => {
useEffect(() => {
if (resAIQuery) {
const warningMsg =
'-- Parseable AI is experimental and may produce incorrect answers\n-- Always verify the generated SQL before executing\n\n';
'-- LLM generated query is experimental and may produce incorrect answers\n-- Always verify the generated SQL before executing\n\n';
setQuery(warningMsg + resAIQuery);
}
}, [resAIQuery]);
Expand Down Expand Up @@ -191,7 +191,7 @@ const QueryCodeEditor: FC = () => {
'& .mantine-Input-input': {
// color: '#FC466B',
border: 'none',
borderRadius:0,
borderRadius: 0,
backgroundColor: 'rgba(84,91,235,.2)',
'::placeholder': {
// color: "rgba(0,0,107,.7)",
Expand All @@ -203,7 +203,7 @@ const QueryCodeEditor: FC = () => {
}}
rightSection={
<Button variant="filled" color="brandPrimary.0" radius={0} onClick={handleAIGenerate} h={'100%'}>
✨ Generate
✨ Generate
</Button>
}
/>
Expand Down

0 comments on commit 77d586d

Please sign in to comment.