Skip to content

Commit

Permalink
fix: merge options into claude payload (#6)
Browse files Browse the repository at this point in the history
  • Loading branch information
chr-hertel authored Sep 21, 2024
1 parent 3513643 commit 1233905
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 1233905

Please sign in to comment.