File tree Expand file tree Collapse file tree 2 files changed +1
-4
lines changed Expand file tree Collapse file tree 2 files changed +1
-4
lines changed Original file line number Diff line number Diff line change 77
88import jedi
99import libcst as cst
10- import tiktoken
1110from jedi .api .classes import Name
1211from libcst import CSTNode
1312
@@ -73,8 +72,7 @@ def get_code_optimization_context(
7372 )
7473
7574 # Handle token limits
76- tokenizer = tiktoken .encoding_for_model ("gpt-4o" )
77- final_read_writable_tokens = len (tokenizer .encode (final_read_writable_code ))
75+ final_read_writable_tokens = len (final_read_writable_code )* 0.75
7876 if final_read_writable_tokens > optim_token_limit :
7977 raise ValueError ("Read-writable code has exceeded token limit, cannot proceed" )
8078
Original file line number Diff line number Diff line change @@ -73,7 +73,6 @@ pytest = ">=7.0.0,!=8.3.4"
7373gitpython = " >=3.1.31"
7474libcst = " >=1.0.1"
7575jedi = " >=0.19.1"
76- tiktoken = " >=0.7.0"
7776timeout-decorator = " >=0.5.0"
7877pytest-timeout = " >=2.1.0"
7978tomlkit = " >=0.11.7"
You can’t perform that action at this time.
0 commit comments