-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
22 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<?php namespace com\openai\unittest; | ||
|
||
use com\openai\Encoding; | ||
use test\{Assert, Test, Values}; | ||
|
||
class EncodingTest { | ||
|
||
#[Test] | ||
public function named() { | ||
Assert::equals(Encoding::$cl100k_base, Encoding::named('cl100k_base')); | ||
} | ||
|
||
#[Test, Values(['gpt-4o', 'gpt-4o-2024-05-13', 'o1-preview', 'omni'])] | ||
public function for_omni_and_o1($model) { | ||
Assert::equals(Encoding::$o200k_base, Encoding::for($model)); | ||
} | ||
|
||
#[Test, Values(['gpt-4', 'gpt-4-0314', 'gpt-3.5-turbo-0301', 'gpt-35'])] | ||
public function for_gpt35_and_40($model) { | ||
Assert::equals(Encoding::$cl100k_base, Encoding::for($model)); | ||
} | ||
} |