Skip to content

Commit

Permalink
Merge pull request #6 from ChobPT/patch-1
Browse files Browse the repository at this point in the history
Add Optional Auth Token Support
  • Loading branch information
ArdaGnsrn authored Nov 20, 2024
2 parents 734d9a4 + 34e905c commit b8ac795
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/OllamaClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,13 @@ class OllamaClient
/**
* @param string $host
*/
public function __construct(string $host = 'http://localhost:11434')
public function __construct(string $host = 'http://localhost:11434', string $apiKey = '')
{
$this->guzzleClient = new Client([
'base_uri' => "$host/api/",
'headers' => [
'Authorization' => "Bearer $apiKey",
],
]);
}

Expand Down

0 comments on commit b8ac795

Please sign in to comment.