mirror of
https://github.com/csunny/DB-GPT.git
synced 2025-09-11 13:58:58 +00:00
feat: app_code deficiency logic complete
This commit is contained in:
@@ -22,7 +22,7 @@ type ChatParams = {
|
|||||||
onError?: (content: string, error?: Error) => void;
|
onError?: (content: string, error?: Error) => void;
|
||||||
};
|
};
|
||||||
|
|
||||||
const useChat = ({ queryAgentURL = '/api/v1/chat/completions', app_code = '' }: Props) => {
|
const useChat = ({ queryAgentURL = '/api/v1/chat/completions', app_code }: Props) => {
|
||||||
const [ctrl, setCtrl] = useState<AbortController>({} as AbortController);
|
const [ctrl, setCtrl] = useState<AbortController>({} as AbortController);
|
||||||
const { scene } = useContext(ChatContext);
|
const { scene } = useContext(ChatContext);
|
||||||
const chat = useCallback(
|
const chat = useCallback(
|
||||||
@@ -103,7 +103,7 @@ const useChat = ({ queryAgentURL = '/api/v1/chat/completions', app_code = '' }:
|
|||||||
onError?.('Sorry, We meet some error, please try agin later.', err as Error);
|
onError?.('Sorry, We meet some error, please try agin later.', err as Error);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
[queryAgentURL],
|
[queryAgentURL, app_code],
|
||||||
);
|
);
|
||||||
|
|
||||||
return { chat, ctrl };
|
return { chat, ctrl };
|
||||||
|
Reference in New Issue
Block a user