mirror of
https://github.com/dzhng/deep-research.git
synced 2026-03-22 07:57:16 +08:00
feat: use CONTEXT_SIZE env variable in trimPrompt function (default 128_000)
- Added CONTEXT_SIZE variable to .env.local. - Updated trimPrompt in providers.ts to use Number(process.env.CONTEXT_SIZE) with a default of 128_000.
This commit is contained in:
@@ -44,7 +44,10 @@ const MinChunkSize = 140;
|
||||
const encoder = getEncoding('o200k_base');
|
||||
|
||||
// trim prompt to maximum context size
|
||||
export function trimPrompt(prompt: string, contextSize = 120_000) {
|
||||
export function trimPrompt(
|
||||
prompt: string,
|
||||
contextSize = Number(process.env.CONTEXT_SIZE) || 128_000,
|
||||
) {
|
||||
if (!prompt) {
|
||||
return '';
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user