Skip to content
This repository was archived by the owner on Jul 16, 2025. It is now read-only.

Commit 345ad70

Browse files
authored
fix: profiler when using files as platform input (#81)
1 parent 9132003 commit 345ad70

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

rector.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
use Rector\Php74\Rector\Closure\ClosureToArrowFunctionRector;
77
use Rector\PHPUnit\CodeQuality\Rector\Class_\PreferPHPUnitSelfCallRector;
88
use Rector\PHPUnit\CodeQuality\Rector\Class_\PreferPHPUnitThisCallRector;
9-
use Rector\PHPUnit\CodeQuality\Rector\MethodCall\AssertCountWithZeroToAssertEmptyRector;
109
use Rector\PHPUnit\Set\PHPUnitSetList;
1110

1211
return RectorConfig::configure()
@@ -25,7 +24,6 @@
2524
])
2625
->withImportNames(importShortClasses: false)
2726
->withSkip([
28-
AssertCountWithZeroToAssertEmptyRector::class,
2927
ClosureToArrowFunctionRector::class,
3028
PreferPHPUnitThisCallRector::class,
3129
])

src/Profiler/TraceablePlatform.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
namespace PhpLlm\LlmChainBundle\Profiler;
66

7+
use PhpLlm\LlmChain\Model\Message\Content\File;
78
use PhpLlm\LlmChain\Model\Model;
89
use PhpLlm\LlmChain\Model\Response\AsyncResponse;
910
use PhpLlm\LlmChain\Model\Response\ResponseInterface;
@@ -33,6 +34,10 @@ public function request(Model $model, array|string|object $input, array $options
3334
{
3435
$response = $this->platform->request($model, $input, $options);
3536

37+
if ($input instanceof File) {
38+
$input = $input::class.': '.$input->getFormat();
39+
}
40+
3641
$this->calls[] = [
3742
'model' => $model,
3843
'input' => is_object($input) ? clone $input : $input,

0 commit comments

Comments
 (0)