Skip to content

Commit

Permalink
Fix style issue
Browse files Browse the repository at this point in the history
  • Loading branch information
Erdem Köse authored and erdemkose committed Nov 30, 2024
1 parent 285f4a1 commit da8d2ac
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions src/ChatSession.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public function sendMessage(PartInterface ...$parts): GenerateContentResponse
->withGenerationConfig($config)
->generateContentWithContents($this->history);

if(!empty($response->candidates)) {
if (!empty($response->candidates)) {
$parts = $response->candidates[0]->content->parts;
$this->history[] = new Content($parts, Role::Model);
}
Expand All @@ -58,7 +58,7 @@ public function sendMessageStream(

$parts = [];
$partsCollectorCallback = function (GenerateContentResponse $response) use ($callback, &$parts) {
if(!empty($response->candidates)) {
if (!empty($response->candidates)) {
array_push($parts, ...$response->parts());
}

Expand Down
16 changes: 8 additions & 8 deletions tests/Unit/ClientTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@

class ClientTest extends TestCase
{
public function testConstructor()
public function testConstructor(): void
{
$client = new Client(
'test-api-key',
Expand All @@ -32,7 +32,7 @@ public function testConstructor()
self::assertInstanceOf(Client::class, $client);
}

public function testWithBaseUrl()
public function testWithBaseUrl(): void
{
$client = new Client(
'test-api-key',
Expand All @@ -42,7 +42,7 @@ public function testWithBaseUrl()
self::assertInstanceOf(Client::class, $client);
}

public function testGeminiPro()
public function testGeminiPro(): void
{
$client = new Client(
'test-api-key',
Expand All @@ -53,7 +53,7 @@ public function testGeminiPro()
self::assertEquals(ModelName::GEMINI_PRO, $model->modelName);
}

public function testGeminiProWithEnum()
public function testGeminiProWithEnum(): void
{
$client = new Client(
'test-api-key',
Expand All @@ -75,7 +75,7 @@ public function testGenerativeModel()
self::assertEquals(ModelName::EMBEDDING_001, $model->modelName);
}

public function testGenerateContent()
public function testGenerateContent(): void
{
$httpRequest = new Request(
'POST',
Expand Down Expand Up @@ -152,7 +152,7 @@ public function testGenerateContent()
self::assertEquals('This is the Gemini Pro response', $response->text());
}

public function testEmbedContent()
public function testEmbedContent(): void
{
$httpRequest = new Request(
'POST',
Expand Down Expand Up @@ -207,7 +207,7 @@ public function testEmbedContent()
self::assertEquals([0.041395925, -0.017692696], $response->embedding->values);
}

public function testCountTokens()
public function testCountTokens(): void
{
$httpRequest = new Request(
'POST',
Expand Down Expand Up @@ -257,7 +257,7 @@ public function testCountTokens()
self::assertEquals(10, $response->totalTokens);
}

public function testListModels()
public function testListModels(): void
{
$httpRequest = new Request(
'GET',
Expand Down

0 comments on commit da8d2ac

Please sign in to comment.