Skip to content

Commit

Permalink
fix: merge options into claude payload (php-llm#6)
Browse files Browse the repository at this point in the history
  • Loading branch information
chr-hertel authored and OskarStark committed Sep 22, 2024
1 parent 2701acd commit 4212e81
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/Anthropic/Model/Claude.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,15 @@ public function __construct(
public function call(MessageBag $messages, array $options = []): Response
{
$system = $messages->getSystemMessage();

$response = $this->runtime->request([
$body = [
'model' => $this->version->value,
'temperature' => $this->temperature,
'max_tokens' => $this->maxTokens,
'system' => $system->content,
'messages' => $messages->withoutSystemMessage(),
]);
];

$response = $this->runtime->request(array_merge($body, $options));

return new Response(new Choice($response['content'][0]['text']));
}
Expand Down

0 comments on commit 4212e81

Please sign in to comment.