fix: 🐛 check if llm is available for labeling request
This commit is contained in:
parent
a29752a3e5
commit
fa3d55cd1b
@ -131,7 +131,10 @@ function Organizrr() {
|
|||||||
const handleFileDrop = (files: FileWithPath[]) => {
|
const handleFileDrop = (files: FileWithPath[]) => {
|
||||||
if (files.length < 1) return;
|
if (files.length < 1) return;
|
||||||
|
|
||||||
|
if (engine.current) {
|
||||||
files.forEach((f) => {
|
files.forEach((f) => {
|
||||||
|
if (!engine.current) return;
|
||||||
|
|
||||||
const id = Math.random().toString(36).replace("0.", "doc_");
|
const id = Math.random().toString(36).replace("0.", "doc_");
|
||||||
const fileId = Math.random().toString(36).replace("0.", "file_");
|
const fileId = Math.random().toString(36).replace("0.", "file_");
|
||||||
|
|
||||||
@ -149,7 +152,7 @@ function Organizrr() {
|
|||||||
|
|
||||||
setGeneratingFilenames((fns) => [...fns, fileId]);
|
setGeneratingFilenames((fns) => [...fns, fileId]);
|
||||||
|
|
||||||
engine.current?.chat.completions
|
engine.current.chat.completions
|
||||||
.create({
|
.create({
|
||||||
messages,
|
messages,
|
||||||
})
|
})
|
||||||
@ -183,6 +186,7 @@ function Organizrr() {
|
|||||||
setGeneratingFilenames((fns) => fns.filter((fn) => fn !== fileId));
|
setGeneratingFilenames((fns) => fns.filter((fn) => fn !== fileId));
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
}
|
||||||
|
|
||||||
setActiveFile(form.getValues().files.length - 1);
|
setActiveFile(form.getValues().files.length - 1);
|
||||||
setActiveDocumentId(
|
setActiveDocumentId(
|
||||||
|
Loading…
Reference in New Issue
Block a user