Skip to content

Commit

Permalink
add model names for new gpt4 turbo models, remove deprecated old mode…
Browse files Browse the repository at this point in the history
…l, add a new test etc.
  • Loading branch information
HelgeSverre committed Mar 26, 2024
1 parent 6fe1c6a commit 088d530
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 3 deletions.
14 changes: 11 additions & 3 deletions src/ModelNames.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 6,25 @@ class ModelNames
{
const DEFAULT = 'gpt-3.5-turbo-instruct';

// Turbo Models
// GPT-3.5-Turbo Models
const TURBO = 'gpt-3.5-turbo';
const TURBO_INSTRUCT = 'gpt-3.5-turbo-instruct';
const TURBO_1106 = 'gpt-3.5-turbo-1106';
const TURBO_0125 = 'gpt-3.5-turbo-0125';

/**
* @deprecated gpt-3.5-turbo-16k
*/
const TURBO_16K = 'gpt-3.5-turbo-16k';

// Legacy Turbo Models
const TURBO_0613 = 'gpt-3.5-turbo-0613';
const TURBO_16K_0613 = 'gpt-3.5-turbo-16k-0613';
const TURBO_0301 = 'gpt-3.5-turbo-0301';

// GPT-4-Turbo Models
const GPT4_TURBO = 'gpt-4-turbo-preview';
const GPT4_TURBO_0125 = 'gpt-4-0125-preview';
const GPT4_TURBO_1106 = 'gpt-4-1106-preview';

// GPT-4 Models
const GPT4 = 'gpt-4';
const GPT4_32K = 'gpt-4-32k';
Expand Down
16 changes: 16 additions & 0 deletions tests/SanityCheck.php
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 80,22 @@
}
});

it('confirms real world usability with GPT4_TURBO model', function () {

$text = file_get_contents(__DIR__.'/samples/wolt-pizza-norwegian.txt');
$result = ReceiptScanner::scan($text, model: ModelNames::GPT4_TURBO);

expect($result)->toBeInstanceOf(Receipt::class)
->and($result->totalAmount)->toBe(568.00)
->and($result->orderRef)->toBe('61e4fb2646c424c5cbc9bc88')
->and($result->date->format('Y-m-d'))->toBe('2023-07-21')
->and($result->taxAmount)->toBe(74.08)
->and($result->currency->value)->toBe('NOK')
->and($result->merchant->name)->toBe('Minde Pizzeria')
->and($result->merchant->vatId)->toBe('921670362MVA')
->and($result->merchant->address)->toBe('Conrad Mohrs veg 5, 5068 Bergen, NOR');
});

it('confirms real world usability with Turbo Instruct model', function () {

$text = file_get_contents(__DIR__.'/samples/wolt-pizza-norwegian.txt');
Expand Down

0 comments on commit 088d530

Please sign in to comment.