Skip to content

Commit 5f45217

Browse files
fix(compass-generative-ai): Increase the character size restriction for query and aggregation genai COMPASS-8369 (#6370)
* limit increased and message improved for PROMPT_TOO_LONG * updating prompt_too_long error msg * updating test
1 parent 181ab92 commit 5f45217

File tree

4 files changed

+5
-5
lines changed

4 files changed

+5
-5
lines changed

packages/compass-generative-ai/src/atlas-ai-service.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ describe('AtlasAiService', function () {
204204
userInput: 'test',
205205
collectionName: 'test',
206206
databaseName: 'peanut',
207-
sampleDocuments: [{ test: '4'.repeat(600000) }],
207+
sampleDocuments: [{ test: '4'.repeat(5120001) }],
208208
requestId: 'abc',
209209
signal: new AbortController().signal,
210210
});
@@ -231,7 +231,7 @@ describe('AtlasAiService', function () {
231231
{ a: '1' },
232232
{ a: '2' },
233233
{ a: '3' },
234-
{ a: '4'.repeat(500000) },
234+
{ a: '4'.repeat(5120001) },
235235
],
236236
requestId: 'abc',
237237
signal: new AbortController().signal,

packages/compass-generative-ai/src/atlas-ai-service.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ type GenerativeAiInput = {
2424

2525
// The size/token validation happens on the server, however, we do
2626
// want to ensure we're not uploading massive documents (some folks have documents > 1mb).
27-
const AI_MAX_REQUEST_SIZE = 100000;
27+
const AI_MAX_REQUEST_SIZE = 5120000;
2828
const AI_MIN_SAMPLE_DOCUMENTS = 1;
2929
const USER_AI_URI = (userId: string) => `unauth/ai/api/v1/hello/${userId}`;
3030
const AGGREGATION_URI = 'ai/api/v1/mql-aggregation';

packages/compass-generative-ai/src/components/generative-ai-input.spec.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ describe('GenerativeAIInput Component', function () {
112112
],
113113
[
114114
'PROMPT_TOO_LONG',
115-
'Sorry, your collections have too many fields to process. Please try using this feature on a collection with smaller documents.',
115+
'Sorry, your request is too large. Please use a smaller prompt or try using this feature on a collection with smaller documents.',
116116
],
117117
[
118118
'TOO_MANY_REQUESTS',

packages/compass-generative-ai/src/components/generative-ai-input.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -569,7 +569,7 @@ const AIError = ({
569569
// able to fix the issue on their own it cases where the schema is too big.
570570
return (
571571
<>
572-
Sorry, your collections have too many fields to process. Please try
572+
Sorry, your request is too large. Please use a smaller prompt or try
573573
using this feature on a collection with smaller documents.
574574
</>
575575
);

0 commit comments

Comments
 (0)