Skip to content

Commit

Permalink
@hook classifai_openai_characters_in_token
Browse files Browse the repository at this point in the history
  • Loading branch information
faisal-alvi committed Oct 24, 2023
1 parent 8c31e19 commit bbeb762
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions includes/Classifai/Providers/OpenAI/Tokenizer.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,18 @@ class Tokenizer {
*/
public function __construct( $max_tokens ) {
$this->max_tokens = $max_tokens;

/**
* How many characters in one token (roughly)
*
* @since 0.1.0
* @hook classifai_openai_characters_in_token
*
* @param int $characters_in_token How many characters in one token (roughly)
*
* @return int
*/
$this->characters_in_token = apply_filters( 'classifai_openai_characters_in_token', $this->characters_in_token );
}

/**
Expand Down

0 comments on commit bbeb762

Please sign in to comment.