Skip to content

Commit

Permalink
feat: Instructrice::get return type
Browse files Browse the repository at this point in the history
  • Loading branch information
adrienbrault committed Apr 19, 2024
1 parent d630449 commit b6c65a2
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/Instructrice.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,17 +31,21 @@ public function __construct(
}

/**
* @param Schema|TypeInterface<mixed>|class-string $type
* @param callable(mixed, LLMChunk): void $onChunk
* @param InstructriceOptions $options
* @template T
*
* @param Schema|TypeInterface<T>|class-string<T> $type
* @param callable(mixed, LLMChunk): void $onChunk
* @param InstructriceOptions $options
*
* @return mixed|T|null
*/
public function get(
array|TypeInterface|string $type,
string $context,
?string $instructions = null,
array $options = [],
?callable $onChunk = null,
): mixed {
) {
$denormalize = fn (mixed $data) => $data;
$schema = $type;
if (! \is_array($schema)) {
Expand Down

0 comments on commit b6c65a2

Please sign in to comment.