Skip to content

v3.0.0

Choose a tag to compare

@HelgeSverre HelgeSverre released this 06 Jan 17:25
· 7 commits to main since this release
095ccb5

Breaking Changes!

The model parameter on the scan()method now accepts a string instead of the (now removed) enum Model.

To upgrade to v3, you need to search-and-replace for all instances in your code that references the Model enum and
change it to the new ModelNames::NAME_HERE class constant, OR simply refer to the model name as a string.

This change was done because at best there was no benefit from using an enum in this case, and at worst it would prevent
you from specifying a model that was not explicitly listed in the enum, which is a silly restriction to have.

The new ModelNames class constants are as follows:

ModelNames Constant Value
ModelNames::TURBO gpt-3.5-turbo
ModelNames::TURBO_INSTRUCT gpt-3.5-turbo-instruct
ModelNames::TURBO_1106 gpt-3.5-turbo-1106
ModelNames::TURBO_16K gpt-3.5-turbo-16k
ModelNames::TURBO_0613 gpt-3.5-turbo-0613
ModelNames::TURBO_16K_0613 gpt-3.5-turbo-16k-0613
ModelNames::TURBO_0301 gpt-3.5-turbo-0301
ModelNames::GPT4 gpt-4
ModelNames::GPT4_32K gpt-4-32k
ModelNames::GPT4_32K_0613 gpt-4-32k-0613
ModelNames::GPT4_1106_PREVIEW gpt-4-1106-preview
ModelNames::GPT4_0314 gpt-4-0314
ModelNames::GPT4_32K_0314 gpt-4-32k-0314

Updating Code for v3.0.0

Before (v2.0.1):

In the previous version, you might have used the Model enum like this:

use HelgeSverre\ReceiptScanner\Enums\Model;

// Example usage in v2
$result = $receiptScanner->scan($inputText, Model::TURBO_INSTRUCT);

After (v3.0.0):

In the new version, replace the Model enum with ModelNames::NAME_HERE constant or a direct string. Here are two ways
to do it:

Using ModelNames Constant:

use HelgeSverre\ReceiptScanner\ModelNames;

$result = $receiptScanner->scan($inputText, ModelNames::TURBO_INSTRUCT);

Using String Directly:

$result = $receiptScanner->scan($inputText, 'gpt-3.5-turbo-instruct');

Full Changelog: v2.0.1...v3.0.0