trim svg elements when prompt exceeds context window (#2106)
This commit is contained in:
5
skyvern/utils/token_counter.py
Normal file
5
skyvern/utils/token_counter.py
Normal file
@@ -0,0 +1,5 @@
|
||||
import tiktoken
|
||||
|
||||
|
||||
def count_tokens(text: str) -> int:
|
||||
return len(tiktoken.encoding_for_model("gpt-4o").encode(text))
|
||||
Reference in New Issue
Block a user