-
-
Notifications
You must be signed in to change notification settings - Fork 5.4k
disable import on hosted instances #339
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
simplify chat interface normalize LLM model interface have compression abstraction Cleanup compressor TODO: Anthropic stuff
Fix lancedb sources
…rning valid metadata sources
frontend/src/pages/GeneralSettings/ExportImport/index.jsxExtracting the logic to check if the instance is hosted into a separate function will make the code more readable and maintainable. This function can be reused in other parts of the code if needed. const isHostedInstance = () => {
const hostname = window.location.hostname;
return hostname.includes(".useanything.com");
}
// Then use it in your component
const isHosted = isHostedInstance();By using the useCallback hook, you can prevent unnecessary re-renders of the component when the handleUpload function is not changed. This can improve the performance of your application. const handleUpload = useCallback(async (e) => {
setLoading(true);
e.preventDefault();
setFile(null);
setResult(null);
const file = e.target.files?.[0];
if (!file) {
showToast("Invalid file upload", "error");
return false;
}
setFile(file);
setLoading(true);
const formData = new FormData();
formData.append("file", file, file.name);
const { success, error } = await System.importData(formData);
if (!success) {
showToast(`Failed to import data: ${error}`, "error");
} else {
setResult(true);
showToast(`Successfully imported ${file.name}`, "success");
}
setLoading(false);
setFile(null);
}, []); |
| const hostname = window.location.hostname; | ||
| const isHosted = hostname.includes(".useanything.com"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Extracted the logic to check if the instance is hosted into a separate function to improve code readability and maintainability.
| const hostname = window.location.hostname; | |
| const isHosted = hostname.includes(".useanything.com"); | |
| const isHostedInstance = () => { | |
| const hostname = window.location.hostname; | |
| return hostname.includes('.useanything.com'); | |
| } | |
| const isHosted = isHostedInstance(); |
* disable import on hosted instances * Update UI on disabled import/export --------- Co-authored-by: timothycarambat <rambat1010@gmail.com>
* disable import on hosted instances * Update UI on disabled import/export --------- Co-authored-by: timothycarambat <rambat1010@gmail.com>
* Using OpenAI API locally * Infinite prompt input and compression implementation (#332) * WIP on continuous prompt window summary * wip * Move chat out of VDB simplify chat interface normalize LLM model interface have compression abstraction Cleanup compressor TODO: Anthropic stuff * Implement compression for Anythropic Fix lancedb sources * cleanup vectorDBs and check that lance, chroma, and pinecone are returning valid metadata sources * Resolve Weaviate citation sources not working with schema * comment cleanup * disable import on hosted instances (#339) * disable import on hosted instances * Update UI on disabled import/export --------- Co-authored-by: timothycarambat <rambat1010@gmail.com> * Add support for gpt-4-turbo 128K model (#340) resolves #336 Add support for gpt-4-turbo 128K model * 315 show citations based on relevancy score (#316) * settings for similarity score threshold and prisma schema updated * prisma schema migration for adding similarityScore setting * WIP * Min score default change * added similarityThreshold checking for all vectordb providers * linting --------- Co-authored-by: shatfield4 <seanhatfield5@gmail.com> * rename localai to lmstudio * forgot files that were renamed * normalize model interface * add model and context window limits * update LMStudio tagline * Fully working LMStudio integration --------- Co-authored-by: Francisco Bischoff <984592+franzbischoff@users.noreply.github.com> Co-authored-by: Timothy Carambat <rambat1010@gmail.com> Co-authored-by: Sean Hatfield <seanhatfield5@gmail.com>
* disable import on hosted instances * Update UI on disabled import/export --------- Co-authored-by: timothycarambat <rambat1010@gmail.com>
* Using OpenAI API locally * Infinite prompt input and compression implementation (Mintplex-Labs#332) * WIP on continuous prompt window summary * wip * Move chat out of VDB simplify chat interface normalize LLM model interface have compression abstraction Cleanup compressor TODO: Anthropic stuff * Implement compression for Anythropic Fix lancedb sources * cleanup vectorDBs and check that lance, chroma, and pinecone are returning valid metadata sources * Resolve Weaviate citation sources not working with schema * comment cleanup * disable import on hosted instances (Mintplex-Labs#339) * disable import on hosted instances * Update UI on disabled import/export --------- Co-authored-by: timothycarambat <rambat1010@gmail.com> * Add support for gpt-4-turbo 128K model (Mintplex-Labs#340) resolves Mintplex-Labs#336 Add support for gpt-4-turbo 128K model * 315 show citations based on relevancy score (Mintplex-Labs#316) * settings for similarity score threshold and prisma schema updated * prisma schema migration for adding similarityScore setting * WIP * Min score default change * added similarityThreshold checking for all vectordb providers * linting --------- Co-authored-by: shatfield4 <seanhatfield5@gmail.com> * rename localai to lmstudio * forgot files that were renamed * normalize model interface * add model and context window limits * update LMStudio tagline * Fully working LMStudio integration --------- Co-authored-by: Francisco Bischoff <984592+franzbischoff@users.noreply.github.com> Co-authored-by: Timothy Carambat <rambat1010@gmail.com> Co-authored-by: Sean Hatfield <seanhatfield5@gmail.com>
resolves #338
Check if hostname is a hosted instance and disables uploading of exported anythingllm data to prevent users from corrupting their db schema on older versions.