php-llm-agent/tests/05_ChainedQuery_ProduceShortContentFromLongContent.php
Frederico @ VilaRosa02 436e0e57c5 new version
2025-09-10 11:40:03 +00:00

13 lines
505 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),80);
foreach($chunks as $chunk) {
$summaries[] = LlamaCli_raw(implode("\n",$chunk),"You are a legal executive assistant that will summarize a conversation in english between ex-husband and wife in 1 paragraph");
}
print_r($summaries);