🪢 Open source agent evals & observability: Trace, evaluate, and improve LLM applications with one open platform.
TypeScript analyticsautogenevaluationlangchainlarge-language-modelsllama-indexllmllm-evaluationllm-observabilityllmopsmonitoringobservabilityopen-sourceopenaiplaygroundprompt-engineeringprompt-managementself-hostedycombinator
chore(datasets): reduce max payload size in csv upload (#5466)
marliessophie778dc24324c4
diff --git a/web/src/features/datasets/components/PreviewCsvImport.tsx b/web/src/features/datasets/components/PreviewCsvImport.tsxindex 1d0b00f8fa..22a9a6c5de 100644--- a/web/src/features/datasets/components/PreviewCsvImport.tsx+++ b/web/src/features/datasets/components/PreviewCsvImport.tsx@@ -25,7 +25,9 @@ import { usePostHogClientCapture } from "@/src/features/posthog-analytics/usePosconst MIN_CHUNK_SIZE = 50;const DELAY_BETWEEN_CHUNKS = 100; // milliseconds-const MAX_PAYLOAD_SIZE = 1 * 1024 * 1024; // 1MB in bytes++// Max payload size is 1MB, but we must account for any trpc wrapper data and context+const MAX_PAYLOAD_SIZE = 500 * 1024; // 500KB in bytesfunction getOptimalChunkSize(items: any[], startSize: number): number {const getPayloadSize = (size: number) =>@@ -37,7 +39,7 @@ function getOptimalChunkSize(items: any[], startSize: number): number {}),).length;- // Binary search for largest chunk size under 1MB+ // Binary search for largest chunk size under MAX_PAYLOAD_SIZElet low = MIN_CHUNK_SIZE;let high = startSize;let best = MIN_CHUNK_SIZE;