Add chunked timeline routing
This commit is contained in:
+7
-2
@@ -6,7 +6,7 @@ require_once __DIR__ . '/../includes/ToolModels.php';
|
||||
|
||||
dbnToolsRequireMethod('POST');
|
||||
dbnToolsRequireAuth();
|
||||
$input = dbnToolsJsonInput(400000);
|
||||
$input = dbnToolsJsonInput(1500000);
|
||||
$language = dbnToolsNormalizeLanguage($input['language'] ?? 'en');
|
||||
$_validEngines = ['nova_lite', 'azure_mini', 'azure_full'];
|
||||
$_requestedEngine = in_array((string)($input['engine'] ?? ''), $_validEngines, true)
|
||||
@@ -15,7 +15,7 @@ $_requestedEngine = in_array((string)($input['engine'] ?? ''), $_validEngines, t
|
||||
$start = microtime(true);
|
||||
|
||||
try {
|
||||
$text = dbnToolsInjectDocContent($input, dbnToolsString($input, 'text', 128000, false));
|
||||
$text = dbnToolsInjectDocContent($input, dbnToolsString($input, 'text', ToolModels::TIMELINE_DEEP_MAX_CHARS, false));
|
||||
if (mb_strlen(trim($text), 'UTF-8') < 10) {
|
||||
dbnToolsAbort('Paste text, upload a file, or select a document before running.', 422, 'empty_text');
|
||||
}
|
||||
@@ -33,6 +33,7 @@ try {
|
||||
}
|
||||
|
||||
$timelineRoute = ToolModels::timelineRoute($ftUid, $_requestedEngine, $text);
|
||||
ToolModels::assertTimelineQuoteAccepted($timelineRoute, $input);
|
||||
$ftUid = dbnToolsFreeTierCheckAmount('timeline', (int)$timelineRoute['credits']);
|
||||
|
||||
$validFocus = ['all', 'deadlines', 'hearings', 'cps'];
|
||||
@@ -71,6 +72,10 @@ try {
|
||||
'auto_upgraded_engine' => $timelineRoute['auto_upgraded_engine'],
|
||||
'input_char_count' => $timelineRoute['input_char_count'],
|
||||
'engine_limit_chars' => $timelineRoute['engine_limit_chars'],
|
||||
'max_char_limit' => $timelineRoute['max_char_limit'],
|
||||
'chunked_timeline' => $timelineRoute['chunked_timeline'],
|
||||
'timeline_chunk_count' => $timelineRoute['timeline_chunk_count'],
|
||||
'estimated_credits' => $timelineRoute['estimated_credits'],
|
||||
'credits_charged' => $timelineRoute['credits'],
|
||||
]);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user