feat(nx-dev): limit ai chat query length (#20034)

This commit is contained in:
Isaac Mann 2023-11-03 16:20:09 -04:00 committed by GitHub
parent b3378b7cd2
commit d1dd605ed2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 3 deletions

View File

@ -121,6 +121,7 @@ export function Prompt({
onChange={onInputChange}
id="query-prompt"
name="query"
maxLength={500}
disabled={isGenerating}
className="block w-full p-0 resize-none bg-transparent text-sm placeholder-slate-500 pl-2 py-[1.3rem] focus-within:outline-none focus:placeholder-slate-400 dark:focus:placeholder-slate-300 dark:text-white focus:outline-none focus:ring-0 border-none disabled:cursor-not-allowed"
placeholder="How does caching work?"

View File

@ -27,9 +27,9 @@ const supabaseUrl = process.env['NX_NEXT_PUBLIC_SUPABASE_URL'];
const supabaseServiceKey = process.env['NX_SUPABASE_SERVICE_ROLE_KEY'];
const openAiKey = process.env['NX_OPENAI_KEY'];
const tokenCountLimit =
parseInt(process.env['NX_TOKEN_COUNT_LIMIT'] ?? '2500') > 0
? parseInt(process.env['NX_TOKEN_COUNT_LIMIT'] ?? '2500')
: 2500;
parseInt(process.env['NX_TOKEN_COUNT_LIMIT'] ?? '500') > 0
? parseInt(process.env['NX_TOKEN_COUNT_LIMIT'] ?? '500')
: 500;
export const config = {
runtime: 'edge',