Skip to content

Commit 445c296

Browse files
committed
Major refactor / redesign pre 2.0.0 release
1 parent e708766 commit 445c296

File tree

8 files changed

+2
-311
lines changed

8 files changed

+2
-311
lines changed

packages/instructor/src/Data/StructuredOutputResponse.php

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,9 @@
77
use Cognesy\Polyglot\Inference\Data\InferenceResponse;
88
use Cognesy\Polyglot\Inference\Data\Usage;
99
use Cognesy\Polyglot\Inference\Enums\InferenceFinishReason;
10-
use Cognesy\Utils\Profiler\TracksObjectCreation;
1110

1211
final readonly class StructuredOutputResponse
1312
{
14-
use TracksObjectCreation;
15-
1613
public static function partial(
1714
mixed $value,
1815
InferenceResponse $rawResponse,
@@ -44,9 +41,7 @@ public function __construct(
4441
private InferenceResponse $rawResponse,
4542
private bool $isPartial = false,
4643
private string $toolArgsSnapshot = '',
47-
) {
48-
$this->trackObjectCreation();
49-
}
44+
) {}
5045

5146
public function value(): mixed
5247
{

packages/instructor/src/Streaming/StructuredOutputStreamState.php

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,9 @@
88
use Cognesy\Polyglot\Inference\Data\PartialInferenceDelta;
99
use Cognesy\Polyglot\Inference\Data\Usage;
1010
use Cognesy\Polyglot\Inference\Streaming\StreamingUsageState;
11-
use Cognesy\Utils\Profiler\TracksObjectCreation;
1211

1312
final class StructuredOutputStreamState
1413
{
15-
use TracksObjectCreation;
16-
1714
private string $content = '';
1815
private string $reasoningContent = '';
1916
private string $finishReason = '';
@@ -35,7 +32,6 @@ final class StructuredOutputStreamState
3532
public function __construct()
3633
{
3734
$this->usage = new StreamingUsageState();
38-
$this->trackObjectCreation();
3935
}
4036

4137
public static function empty(): self

packages/instructor/tests/Fixtures/streaming_object_profile_1000.json

Lines changed: 0 additions & 31 deletions
This file was deleted.

packages/instructor/tests/Integration/StreamingObjectProfile1000Test.php

Lines changed: 0 additions & 133 deletions
This file was deleted.

packages/polyglot/src/Inference/Data/PartialInferenceDelta.php

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,12 @@
33
namespace Cognesy\Polyglot\Inference\Data;
44

55
use Cognesy\Http\Data\HttpResponse;
6-
use Cognesy\Utils\Profiler\TracksObjectCreation;
76

87
/**
98
* Typed delta payload parsed from one streaming event.
109
*/
1110
final readonly class PartialInferenceDelta
1211
{
13-
use TracksObjectCreation;
14-
1512
public function __construct(
1613
public string $contentDelta = '',
1714
public string $reasoningContentDelta = '',
@@ -23,7 +20,5 @@ public function __construct(
2320
public bool $usageIsCumulative = false,
2421
public ?HttpResponse $responseData = null,
2522
public mixed $value = null,
26-
) {
27-
$this->trackObjectCreation();
28-
}
23+
) {}
2924
}

packages/polyglot/src/Inference/Streaming/InferenceStreamState.php

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,9 @@
77
use Cognesy\Polyglot\Inference\Data\InferenceResponse;
88
use Cognesy\Polyglot\Inference\Data\PartialInferenceDelta;
99
use Cognesy\Polyglot\Inference\Data\Usage;
10-
use Cognesy\Utils\Profiler\TracksObjectCreation;
1110

1211
final class InferenceStreamState
1312
{
14-
use TracksObjectCreation;
15-
1613
private string $content = '';
1714
private int $contentLength = 0;
1815
private string $reasoningContent = '';
@@ -40,7 +37,6 @@ final class InferenceStreamState
4037
public function __construct()
4138
{
4239
$this->usage = new StreamingUsageState();
43-
$this->trackObjectCreation();
4440
}
4541

4642
public function applyDelta(PartialInferenceDelta $delta): void

packages/polyglot/tests/Fixtures/streaming_object_profile_1000.json

Lines changed: 0 additions & 21 deletions
This file was deleted.

packages/polyglot/tests/Integration/StreamingObjectProfile1000Test.php

Lines changed: 0 additions & 106 deletions
This file was deleted.

0 commit comments

Comments
 (0)