Skip to content

Commit 3b9df19

Browse files
authored
Merge pull request #12 from pamelafox/rmprint
Remove spurious print call
2 parents 0e83623 + 62acded commit 3b9df19

File tree

3 files changed

+5
-2
lines changed

3 files changed

+5
-2
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22

33
All notable changes to this project will be documented in this file.
44

5+
## [0.1.5] - June 4, 2024
6+
7+
- Remove spurious `print` call when counting tokens for function calling.
8+
59
## [0.1.4] - May 14, 2024
610

711
- Add support and tests for gpt-4o, which has a different tokenizer.

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[project]
22
name = "openai-messages-token-helper"
33
description = "A helper library for estimating tokens used by messages sent through OpenAI Chat Completions API."
4-
version = "0.1.4"
4+
version = "0.1.5"
55
authors = [{name = "Pamela Fox"}]
66
requires-python = ">=3.9"
77
readme = "README.md"

src/openai_messages_token_helper/model_helper.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,6 @@ def count_tokens_for_system_and_tools(
145145
tokens += count_tokens_for_message(model, system_message, default_to_cl100k)
146146
if tools:
147147
encoding = tiktoken.encoding_for_model(model)
148-
print(format_function_definitions(tools))
149148
tokens += len(encoding.encode(format_function_definitions(tools)))
150149
tokens += 9 # Additional tokens for function definition of tools
151150
# If there's a system message and tools are present, subtract four tokens

0 commit comments

Comments
 (0)