Skip to content

Commit

Permalink
Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
butschster committed Sep 10, 2024
1 parent 5626e6a commit 79c18a8
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/LLM.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,13 +61,13 @@ public function generate(
$request['messages'][] = $this->messageMapper->map($message);
}

if ($options->has(Option::Tools)) {
if ($options->has(Option::Tools->value)) {
$request = $this->configureTools($options, $request);
}

$callback = null;
if ($options->has(Option::StreamChunkCallback)) {
$callback = $options->get(Option::StreamChunkCallback);
if ($options->has(Option::StreamChunkCallback->value)) {
$callback = $options->get(Option::StreamChunkCallback->value);
\assert($callback instanceof StreamChunkCallbackInterface);
}

Expand Down Expand Up @@ -108,12 +108,12 @@ protected function buildOptions(OptionsInterface $options): array
return \array_filter($result, static fn($value): bool => $value !== null);
}

protected function configureTools(Options $options, array $request): array
protected function configureTools(OptionsInterface $options, array $request): array
{
$tools = \array_values(
\array_map(
fn(Tool $tool): array => $this->messageMapper->map($tool),
$options->get(Option::Tools),
$options->get(Option::Tools->value),
),
);

Expand Down

0 comments on commit 79c18a8

Please sign in to comment.