feat(nx-dev): limit ai chat query length (#20034)
This commit is contained in:
parent
b3378b7cd2
commit
d1dd605ed2
@ -121,6 +121,7 @@ export function Prompt({
|
|||||||
onChange={onInputChange}
|
onChange={onInputChange}
|
||||||
id="query-prompt"
|
id="query-prompt"
|
||||||
name="query"
|
name="query"
|
||||||
|
maxLength={500}
|
||||||
disabled={isGenerating}
|
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"
|
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?"
|
placeholder="How does caching work?"
|
||||||
|
|||||||
@ -27,9 +27,9 @@ const supabaseUrl = process.env['NX_NEXT_PUBLIC_SUPABASE_URL'];
|
|||||||
const supabaseServiceKey = process.env['NX_SUPABASE_SERVICE_ROLE_KEY'];
|
const supabaseServiceKey = process.env['NX_SUPABASE_SERVICE_ROLE_KEY'];
|
||||||
const openAiKey = process.env['NX_OPENAI_KEY'];
|
const openAiKey = process.env['NX_OPENAI_KEY'];
|
||||||
const tokenCountLimit =
|
const tokenCountLimit =
|
||||||
parseInt(process.env['NX_TOKEN_COUNT_LIMIT'] ?? '2500') > 0
|
parseInt(process.env['NX_TOKEN_COUNT_LIMIT'] ?? '500') > 0
|
||||||
? parseInt(process.env['NX_TOKEN_COUNT_LIMIT'] ?? '2500')
|
? parseInt(process.env['NX_TOKEN_COUNT_LIMIT'] ?? '500')
|
||||||
: 2500;
|
: 500;
|
||||||
|
|
||||||
export const config = {
|
export const config = {
|
||||||
runtime: 'edge',
|
runtime: 'edge',
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user