php-llm-agent/tests/05_ChainedQuery_ProduceShortContentFromLongContent.php
2025-09-11 10:58:00 +00:00

17 lines
543 B
PHP

<?php require_once __DIR__."/../LlamaCli.func.php";
// TEST 05: CHAINED QUERY, to parse long-content and produce short one. SUMMARIZATION. ( GOAL: )
$summaries = [];
$content = file_get_contents("test_input_data.2.txt");
$chunks = array_chunk(explode("\n",$content),100);
foreach($chunks as $chunk) {
$summaries[] = LlamaCli_raw(
implode("\n",$chunk),
"You are a legal executive assistant that will count how many times the ex-husband Frederico has visited the kids in Tampere. ",
["context_size" => 8192]
);
}
print_r($summaries);