feat(app): add auto video & image search

This commit is contained in:
ItzCrazyKns
2025-02-15 11:29:59 +05:30
parent 41d056e755
commit 5cbc512322
3 changed files with 24 additions and 8 deletions

View File

@ -58,14 +58,17 @@ const useSocket = (
let embeddingModelProvider = localStorage.getItem(
'embeddingModelProvider',
);
let openAIBaseURL =
chatModelProvider === 'custom_openai'
? localStorage.getItem('openAIBaseURL')
: null;
let openAIPIKey =
chatModelProvider === 'custom_openai'
? localStorage.getItem('openAIApiKey')
: null;
const autoImageSearch = localStorage.getItem('autoImageSearch');
const autoVideoSearch = localStorage.getItem('autoVideoSearch');
if (!autoImageSearch) {
localStorage.setItem('autoImageSearch', 'true');
}
if (!autoVideoSearch) {
localStorage.setItem('autoVideoSearch', 'false');
}
const providers = await fetch(
`${process.env.NEXT_PUBLIC_API_URL}/models`,
@ -595,6 +598,17 @@ const ChatWindow = ({ id }: { id?: string }) => {
}),
);
}
const autoImageSearch = localStorage.getItem('autoImageSearch');
const autoVideoSearch = localStorage.getItem('autoVideoSearch');
if (autoImageSearch === 'true') {
document.getElementById('search-images')?.click();
}
if (autoVideoSearch === 'true') {
document.getElementById('search-videos')?.click();
}
}
};

View File

@ -27,6 +27,7 @@ const SearchImages = ({
<>
{!loading && images === null && (
<button
id="search-images"
onClick={async () => {
setLoading(true);

View File

@ -42,6 +42,7 @@ const Searchvideos = ({
<>
{!loading && videos === null && (
<button
id="search-videos"
onClick={async () => {
setLoading(true);